Struct background_jobs::QueueHandle [−][src]
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.
Implementations
impl QueueHandle
[src]
pub fn queue<J>(&self, job: J) -> Result<(), Error> where
J: Job,
[src]
J: Job,
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 schedule<J>(&self, job: J, after: DateTime<Utc>) -> Result<(), Error> where
J: Job,
[src]
J: Job,
Schedule a job for execution later
This job will be sent to the server for storage, and will execute after the specified time and when 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 + Send + 'static,
[src]
J: Job + Clone + Send + 'static,
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 async fn get_stats(&'_ self) -> Result<Stats, Error>
[src]
Return an overview of the processor's statistics
Trait Implementations
impl Clone for QueueHandle
[src]
pub fn clone(&self) -> QueueHandle
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for QueueHandle
[src]
impl Send for QueueHandle
[src]
impl Sync for QueueHandle
[src]
impl Unpin for QueueHandle
[src]
impl !UnwindSafe for QueueHandle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,