pub struct WorkerHandle { /* private fields */ }Expand description
Remote control for a running Worker. Cheap to clone and send across tasks.
Implementations§
Source§impl WorkerHandle
impl WorkerHandle
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Ask the worker to stop. Returns immediately; Worker::run finishes the jobs
that are already running before it returns.
Calling this more than once, or before Worker::run starts, is fine.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Whether WorkerHandle::shutdown has been called.
Sourcepub fn settle_failures(&self) -> u64
pub fn settle_failures(&self) -> u64
How many times the worker failed to ack / retry / dead-letter a delivery.
Each failure is also logged at ERROR. The job itself ran; only telling the
broker about the outcome failed, so the message is still owned by the broker
and will be redelivered. A non-zero (and especially a growing) count means
duplicate processing, and usually a sick connection. Alert on it.
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 (const: unstable) · 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 UnsafeUnpin 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