pub trait BackgroundTaskExt {
// Required method
fn enqueue<'life0, 'async_trait, S>(
self,
connection: &'life0 mut S::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>
where S: 'async_trait + TaskStore,
Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A trait that is used to enqueue tasks for a given connection type
Required Methods§
Sourcefn enqueue<'life0, 'async_trait, S>(
self,
connection: &'life0 mut S::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>where
S: 'async_trait + TaskStore,
Self: 'async_trait,
'life0: 'async_trait,
fn enqueue<'life0, 'async_trait, S>(
self,
connection: &'life0 mut S::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>where
S: 'async_trait + TaskStore,
Self: 'async_trait,
'life0: 'async_trait,
Enqueue a task for execution.
This method accepts a connection thus enabling the user to use a transaction while scheduling tasks. This is useful if you want to schedule a task only if some other condition is met.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.