Skip to main content

QueueExt

Trait QueueExt 

Source
pub trait QueueExt: Queue {
    // Provided methods
    fn dispatch_chain<'a>(
        &'a self,
        chain: Chain,
    ) -> BoxFuture<'a, Result<String>> { ... }
    fn dispatch<'a, J: Job>(
        &'a self,
        job: &'a J,
    ) -> BoxFuture<'a, Result<String>> { ... }
    fn dispatch_on<'a, J: Job>(
        &'a self,
        queue: &'a str,
        job: &'a J,
    ) -> BoxFuture<'a, Result<String>> { ... }
    fn dispatch_later<'a, J: Job>(
        &'a self,
        delay: Duration,
        job: &'a J,
    ) -> BoxFuture<'a, Result<String>> { ... }
}
Expand description

The conveniences that take a concrete job type, and so cannot live on a dyn-compatible trait. Blanket-implemented, including for dyn Queue.

Provided Methods§

Source

fn dispatch_chain<'a>(&'a self, chain: Chain) -> BoxFuture<'a, Result<String>>

dispatch(SendWelcomeEmail { user_id }) — the everyday call. Push the first step of a chain; the worker pushes each next step as the one before it succeeds. Returns the first step’s id.

Source

fn dispatch<'a, J: Job>(&'a self, job: &'a J) -> BoxFuture<'a, Result<String>>

Source

fn dispatch_on<'a, J: Job>( &'a self, queue: &'a str, job: &'a J, ) -> BoxFuture<'a, Result<String>>

Dispatch onto a named queue instead of the job’s own.

Source

fn dispatch_later<'a, J: Job>( &'a self, delay: Duration, job: &'a J, ) -> BoxFuture<'a, Result<String>>

Dispatch, but not before delay has passed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T: Queue + ?Sized> QueueExt for T