pub trait Worker:
Send
+ Sync
+ UnwindSafe {
type Context: Clone + Send + Sync;
type Error: Error + Send + Sync;
// Required method
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Context<Self::Context>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn max_retries(&self) -> u32 { ... }
fn retry_delay(&self, retries: u32) -> u64 { ... }
fn unique_id(&self) -> Option<String> { ... }
fn on_conflict(&self) -> JobConflictStrategy { ... }
fn cron_schedule() -> Option<String>
where Self: Sized { ... }
fn cron_queue_config() -> Option<QueueConfig>
where Self: Sized { ... }
fn to_config() -> WorkerConfigKind
where Self: Sized { ... }
}Required Associated Types§
Required Methods§
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Context<Self::Context>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn max_retries(&self) -> u32
fn retry_delay(&self, retries: u32) -> u64
fn unique_id(&self) -> Option<String>
fn on_conflict(&self) -> JobConflictStrategy
Sourcefn cron_schedule() -> Option<String>where
Self: Sized,
fn cron_schedule() -> Option<String>where
Self: Sized,
6 part cron schedule: “* * * * * *”