Trait Handler

Source
pub trait Handler {
    // Required method
    fn process_job(
        &self,
        queue_name: &[u8],
        jobid: &String,
        body: Vec<u8>,
    ) -> JobStatus;

    // Provided method
    fn process_error(&self, _: &[u8], _: &String, _: u32, _: u32) -> bool { ... }
}
Expand description

Handles a job task.

Required Methods§

Source

fn process_job( &self, queue_name: &[u8], jobid: &String, body: Vec<u8>, ) -> JobStatus

Process a job.

Provided Methods§

Source

fn process_error(&self, _: &[u8], _: &String, _: u32, _: u32) -> bool

Decides if a job that failed in the past should be re-executed. nack is the count of negatives acknowledges. additional_deliveries is the number of times the job was processed but it was not acknowledged.

Implementors§