pub trait Worker:
Send
+ Sync
+ 'static {
// Required methods
fn kind(&self) -> &'static str;
fn perform<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_row: &'life1 JobRow,
ctx: &'life2 JobContext,
) -> Pin<Box<dyn Future<Output = Result<JobResult, JobError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Worker trait — implement this for each job type.
Required Methods§
Sourcefn perform<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_row: &'life1 JobRow,
ctx: &'life2 JobContext,
) -> Pin<Box<dyn Future<Output = Result<JobResult, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn perform<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_row: &'life1 JobRow,
ctx: &'life2 JobContext,
) -> Pin<Box<dyn Future<Output = Result<JobResult, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute the job. The raw args JSON and context are provided.