pub trait QueueDriver: Send + Sync {
type Job: Send + Sync + Serialize + for<'de> Deserialize<'de>;
// Required methods
fn push<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
job: Self::Job,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn pop<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, Self::Job)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn reject<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
requeue: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn size<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn purge<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Trait for queue drivers
Required Associated Types§
Required Methods§
Sourcefn push<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
job: Self::Job,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn push<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
job: Self::Job,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pushes a job to the queue
Sourcefn pop<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, Self::Job)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pop<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, Self::Job)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pops a job from the queue
Sourcefn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Acknowledges job completion
Sourcefn reject<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
requeue: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reject<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
requeue: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Rejects a job (puts it back in queue or dead letter)