Skip to main content

JobHandler

Trait JobHandler 

Source
pub trait JobHandler: Send + Sync {
    // Required method
    fn handle(&self, job: Job) -> JobFuture;
}
Expand description

A handler for processing a single job.

Required Methods§

Source

fn handle(&self, job: Job) -> JobFuture

Handles one job, returning a future the pool awaits before acking.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> JobHandler for F
where F: Fn(Job) -> Fut + Send + Sync, Fut: Future<Output = Result<(), JobError>> + Send + 'static,