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
Required Methods
sourcefn 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 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,
Put a job in the queue