pub trait JobQueue: Send + Sync {
    type Err: Error + Send;
    type Handle: JobHandle;
    type Consumer: Consumer;

    fn put_job<'life0, 'async_trait, D>(
        &'life0 self,
        job: D
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
    where
        D: AsRef<[u8]> + Send,
        D: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn get_job<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<JobResult<Self::Handle>, Self::Err>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn consumer<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Self::Consumer> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

An abstract queue that handles reliable delivery through job acknowledgment and optionally persistence

Required Associated Types

The type of error that can occur when getting/putting a job

The type of handle returned by this JobQueue

The type of Consumer Stream this JobQueue produces

Required Methods

Put a job in the queue

Get a job from this queue

Get a Consumer for this JobQueue to allow Stream usage

Implementors