pub struct SaturatorHandle<T> { /* private fields */ }Expand description
Handle to send work to a saturator.
The handle is cheap to clone and can be shared across threads. When all handles are dropped, the saturator will finish processing remaining work and shut down.
Implementations§
Source§impl<T: Send + 'static> SaturatorHandle<T>
impl<T: Send + 'static> SaturatorHandle<T>
Sourcepub fn submit(&self, work: T, scope: Option<&EventScope>)
pub fn submit(&self, work: T, scope: Option<&EventScope>)
Submit high-priority work with optional scope tracking.
Follows the EventScope pattern from event_bus.rs:252-259:
scope is incremented before submit and decremented after completion.
§Arguments
work- The work data to processscope- Optional scope for lifecycle tracking
Sourcepub fn submit_background(&self, work: T, scope: Option<&EventScope>)
pub fn submit_background(&self, work: T, scope: Option<&EventScope>)
Submit low-priority background work.
§Arguments
work- The work data to processscope- Optional scope for lifecycle tracking
Sourcepub fn submit_request(&self, request: SaturationRequest<T>)
pub fn submit_request(&self, request: SaturationRequest<T>)
Submit a request with explicit priority.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Request shutdown of the saturator.
The worker will finish processing remaining items before stopping.
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Check if the saturator is shutting down.
Trait Implementations§
Source§impl<T> Clone for SaturatorHandle<T>
impl<T> Clone for SaturatorHandle<T>
Auto Trait Implementations§
impl<T> Freeze for SaturatorHandle<T>
impl<T> !RefUnwindSafe for SaturatorHandle<T>
impl<T> Send for SaturatorHandle<T>where
T: Send,
impl<T> Sync for SaturatorHandle<T>where
T: Send,
impl<T> Unpin for SaturatorHandle<T>
impl<T> UnsafeUnpin for SaturatorHandle<T>
impl<T> !UnwindSafe for SaturatorHandle<T>
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