pub trait DiscardHandler<TKey, TMsg>:
Send
+ Sync
+ 'static{
// Required method
fn discard(&self, reason: DiscardReason, job: &mut Job<TKey, TMsg>);
}Expand description
Trait defining the discard handler for a factory.
Required Methods§
Sourcefn discard(&self, reason: DiscardReason, job: &mut Job<TKey, TMsg>)
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.