Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
expose PayloadTaskGuard from reth_basic_payload_builder (paradigm…
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes authored Apr 28, 2024
1 parent ead0fbf commit cf6d34c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,13 @@ pub struct PrecachedState {

/// Restricts how many generator tasks can be executed at once.
#[derive(Debug, Clone)]
struct PayloadTaskGuard(Arc<Semaphore>);
pub struct PayloadTaskGuard(Arc<Semaphore>);

// === impl PayloadTaskGuard ===

impl PayloadTaskGuard {
fn new(max_payload_tasks: usize) -> Self {
/// Constructs `Self` with a maximum task count of `max_payload_tasks`.
pub fn new(max_payload_tasks: usize) -> Self {
Self(Arc::new(Semaphore::new(max_payload_tasks)))
}
}
Expand Down

0 comments on commit cf6d34c

Please sign in to comment.