pub trait Worker<Args>: Send + Sync {
// Required method
fn perform<'life0, 'async_trait>(
&'life0 self,
args: Args,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn disable_argument_coercion(&self) -> bool { ... }
fn opts() -> WorkerOpts<Args, Self>
where Self: Sized { ... }
fn max_retries(&self) -> usize { ... }
fn class_name() -> String
where Self: Sized { ... }
fn perform_async<'life0, 'async_trait>(
redis: &'life0 Pool<RedisConnectionManager>,
args: Args,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Sized + 'async_trait,
Args: Send + Sync + Serialize + 'static { ... }
fn perform_in<'life0, 'async_trait>(
redis: &'life0 Pool<RedisConnectionManager>,
duration: Duration,
args: Args,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Sized + 'async_trait,
Args: Send + Sync + Serialize + 'static { ... }
}Required Methods§
fn perform<'life0, 'async_trait>(
&'life0 self,
args: Args,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Provided Methods§
Sourcefn disable_argument_coercion(&self) -> bool
fn disable_argument_coercion(&self) -> bool
Signal to WorkerRef to not attempt to modify the JsonValue args
before calling the perform function. This is useful if the args
are expected to be a Vec<T> that might be len() == 1 or a
single sized tuple (T,).
fn opts() -> WorkerOpts<Args, Self>where
Self: Sized,
fn max_retries(&self) -> usize
Sourcefn class_name() -> Stringwhere
Self: Sized,
fn class_name() -> Stringwhere
Self: Sized,
Derive a class_name from the Worker type to be used with sidekiq. By default this method will
fn perform_async<'life0, 'async_trait>( redis: &'life0 Pool<RedisConnectionManager>, args: Args, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
fn perform_in<'life0, 'async_trait>( redis: &'life0 Pool<RedisConnectionManager>, duration: Duration, args: Args, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
Implementors§
impl Worker<Email> for MailerWorker
Implementation of the Worker trait for the MailerWorker.