Skip to main content

DiscardHandler

Trait DiscardHandler 

Source
pub trait DiscardHandler<TKey, TMsg>:
    Send
    + Sync
    + 'static
where TKey: JobKey, TMsg: Message,
{ // Required method fn discard(&self, reason: DiscardReason, job: &mut Job<TKey, TMsg>); }
Expand description

Trait defining the discard handler for a factory.

Required Methods§

Source

fn discard(&self, reason: DiscardReason, job: &mut Job<TKey, TMsg>)

Called on a job prior to being dropped from the factory.

Useful scenarios are (a) collecting metrics, (b) logging, (c) tearing down resources in the job, etc.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§