pub struct GovernedHydrationPool { /* private fields */ }Expand description
Webizen-governed 3-tier hydration worker pool.
Implementations§
Source§impl GovernedHydrationPool
impl GovernedHydrationPool
Sourcepub fn new(max_queue_capacity: usize) -> Self
pub fn new(max_queue_capacity: usize) -> Self
Create a new governed hydration pool with bounded per-tier queue capacity.
Sourcepub fn submit(
&mut self,
token: &mut HydrationCapabilityToken,
task: HydrationTask,
) -> Result<(), GovernancePoolError>
pub fn submit( &mut self, token: &mut HydrationCapabilityToken, task: HydrationTask, ) -> Result<(), GovernancePoolError>
Submit a hydration task after authorizing and deducting fuel + byte budgets from token.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of pending tasks across all tiers.
Sourcepub fn completed_count(&self) -> u64
pub fn completed_count(&self) -> u64
Total tasks completed so far.
Sourcepub fn step_one(
&mut self,
) -> Result<Option<HydrationReceipt>, GovernancePoolError>
pub fn step_one( &mut self, ) -> Result<Option<HydrationReceipt>, GovernancePoolError>
Pop the highest-priority pending task (Tier0 -> Tier1 -> Tier2) and execute it.
Sourcepub fn drain_bounded(
&mut self,
max_tasks: usize,
) -> Result<Vec<HydrationReceipt>, GovernancePoolError>
pub fn drain_bounded( &mut self, max_tasks: usize, ) -> Result<Vec<HydrationReceipt>, GovernancePoolError>
Drain up to max_tasks in strict priority order (Tier0 before Tier1 before Tier2).
Auto Trait Implementations§
impl Freeze for GovernedHydrationPool
impl RefUnwindSafe for GovernedHydrationPool
impl Send for GovernedHydrationPool
impl Sync for GovernedHydrationPool
impl Unpin for GovernedHydrationPool
impl UnsafeUnpin for GovernedHydrationPool
impl UnwindSafe for GovernedHydrationPool
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more