mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
expose PayloadTaskGuard from reth_basic_payload_builder (#7945)
This commit is contained in:
@ -226,12 +226,13 @@ pub struct PrecachedState {
|
|||||||
|
|
||||||
/// Restricts how many generator tasks can be executed at once.
|
/// Restricts how many generator tasks can be executed at once.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
struct PayloadTaskGuard(Arc<Semaphore>);
|
pub struct PayloadTaskGuard(Arc<Semaphore>);
|
||||||
|
|
||||||
// === impl PayloadTaskGuard ===
|
// === impl PayloadTaskGuard ===
|
||||||
|
|
||||||
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)))
|
Self(Arc::new(Semaphore::new(max_payload_tasks)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user