pub struct FanoutScheduler { /* private fields */ }Expand description
Cancellation-aware stable-order bounded fanout scheduler.
Implementations§
Source§impl FanoutScheduler
impl FanoutScheduler
Sourcepub const fn new(policy: FanoutPolicy) -> Self
pub const fn new(policy: FanoutPolicy) -> Self
Creates a scheduler from validated bounds.
Sourcepub async fn run<T, E, F, Fut>(
&self,
targets: Vec<HostRecord>,
cancellation: CancellationToken,
operation: F,
) -> FanoutReport<T, E>
pub async fn run<T, E, F, Fut>( &self, targets: Vec<HostRecord>, cancellation: CancellationToken, operation: F, ) -> FanoutReport<T, E>
Executes one operation for every target with bounded concurrency.
Returned outcomes are sorted back into the caller’s target order even when faster targets complete first. Pending targets become cancelled after the shared token is cancelled instead of disappearing.
Sourcepub async fn run_with_payload<P, T, E, F, Fut>(
&self,
targets: Vec<(HostRecord, P)>,
cancellation: CancellationToken,
operation: F,
) -> FanoutReport<T, E>
pub async fn run_with_payload<P, T, E, F, Fut>( &self, targets: Vec<(HostRecord, P)>, cancellation: CancellationToken, operation: F, ) -> FanoutReport<T, E>
Executes one operation for every host/payload pair with bounded concurrency.
Payloads remain paired with their original target index, allowing callers to fan out distinct requests to the same host without key-based races.
Trait Implementations§
Source§impl Clone for FanoutScheduler
impl Clone for FanoutScheduler
Source§fn clone(&self) -> FanoutScheduler
fn clone(&self) -> FanoutScheduler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FanoutScheduler
impl Debug for FanoutScheduler
impl Copy for FanoutScheduler
Auto Trait Implementations§
impl Freeze for FanoutScheduler
impl RefUnwindSafe for FanoutScheduler
impl Send for FanoutScheduler
impl Sync for FanoutScheduler
impl Unpin for FanoutScheduler
impl UnsafeUnpin for FanoutScheduler
impl UnwindSafe for FanoutScheduler
Blanket Implementations§
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