pub trait QueueBackend: Send + Sync {
// Required methods
fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
job_type: &'life1 str,
payload: Value,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Uuid, QueueError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<JobEntry>, QueueError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
status: JobStatus,
error: Option<String>,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<JobStatus, QueueError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
job_type: &'life1 str,
payload: Value,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Uuid, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
job_type: &'life1 str,
payload: Value,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Uuid, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enqueue a job payload
Sourcefn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<JobEntry>, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<JobEntry>, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Pull next available job
Sourcefn update_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
status: JobStatus,
error: Option<String>,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
status: JobStatus,
error: Option<String>,
delay_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update job status (ack/nack)
delay_secs is used for retries - how long to wait before the job is available again
Sourcefn get_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<JobStatus, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<JobStatus, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get job status