JobQueueBackend

Trait JobQueueBackend 

Source
pub trait JobQueueBackend<T>: Clone {
    type Context: Send;

    // Required methods
    fn setup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), JobQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn produce<'life0, 'async_trait>(
        &'life0 self,
        job: Job<T>,
    ) -> Pin<Box<dyn Future<Output = Result<(), JobQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn consume<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(Job<T>, Self::Context), JobQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn done<'life0, 'async_trait>(
        &'life0 self,
        job: Job<T>,
        ctx: Self::Context,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn failed<'life0, 'async_trait>(
        &'life0 self,
        job: Job<T>,
        ctx: Self::Context,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn setup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), JobQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn produce<'life0, 'async_trait>( &'life0 self, job: Job<T>, ) -> Pin<Box<dyn Future<Output = Result<(), JobQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn consume<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Job<T>, Self::Context), JobQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn done<'life0, 'async_trait>( &'life0 self, job: Job<T>, ctx: Self::Context, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn failed<'life0, 'async_trait>( &'life0 self, job: Job<T>, ctx: Self::Context, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

Implementors§