[][src]Struct background_jobs::QueueHandle

pub struct QueueHandle { /* fields omitted */ }

A handle to the job server, used for queuing new jobs

QueueHandle should be stored in your application's state in order to allow all parts of your application to spawn jobs.

Methods

impl QueueHandle[src]

pub fn queue<J>(&self, job: J) -> Result<(), Error> where
    J: Job
[src]

Queues a job for execution

This job will be sent to the server for storage, and will execute whenever a worker for the job's queue is free to do so.

pub fn every<J>(&self, duration: Duration, job: J) where
    J: Job + Clone + 'static, 
[src]

Queues a job for recurring execution

This job will be added to it's queue on the server once every Duration. It will be processed whenever workers are free to do so.

pub fn get_stats(
    &self
) -> Box<dyn Future<Item = Stats, Error = Error> + 'static + Send>
[src]

Return an overview of the processor's statistics

Trait Implementations

impl Clone for QueueHandle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,