pub struct WorkerHandle { /* private fields */ }Expand description
A handle to the worker task.
Used for shutting down the worker and waiting for it to finish.
Implementations§
Source§impl WorkerHandle
impl WorkerHandle
Sourcepub async fn shut_down(&self)
pub async fn shut_down(&self)
Signal the worker to shut down after processing any in-flight batches.
Note that when using the Size policy this may wait indefinitely if no new items are added.
Sourcepub async fn wait_for_shutdown(&self)
pub async fn wait_for_shutdown(&self)
Wait for the worker to finish.
Trait Implementations§
Source§impl Clone for WorkerHandle
impl Clone for WorkerHandle
Source§fn clone(&self) -> WorkerHandle
fn clone(&self) -> WorkerHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkerHandle
impl RefUnwindSafe for WorkerHandle
impl Send for WorkerHandle
impl Sync for WorkerHandle
impl Unpin for WorkerHandle
impl UnwindSafe for WorkerHandle
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