pub struct DatabaseQueue { /* private fields */ }Expand description
Jobs in the application’s database.
Implementations§
Trait Implementations§
Source§impl Clone for DatabaseQueue
impl Clone for DatabaseQueue
Source§impl QueueDriver for DatabaseQueue
impl QueueDriver for DatabaseQueue
fn name(&self) -> &'static str
Source§fn push<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
queue: &'life1 str,
name: &'life2 str,
payload: &'life3 Value,
available_at: DateTime<Utc>,
unique_key: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = CoreResult<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn push<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
queue: &'life1 str,
name: &'life2 str,
payload: &'life3 Value,
available_at: DateTime<Utc>,
unique_key: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = CoreResult<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Stores a job;
None when unique_key names one already waiting.Source§fn claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queues: &'life1 [String],
retry_after: Duration,
worker: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<Option<Queued>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queues: &'life1 [String],
retry_after: Duration,
worker: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<Option<Queued>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Claims the oldest job due on one of
queues, or one whose claim is
older than retry_after, for worker. Its attempts count this claim.Source§fn release<'life0, 'async_trait>(
&'life0 self,
id: i64,
available_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release<'life0, 'async_trait>(
&'life0 self,
id: i64,
available_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Puts a claimed job back, due at
available_at.Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes a finished job.
Source§fn fail<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job: &'life1 Queued,
error: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fail<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job: &'life1 Queued,
error: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Moves a job to the failed list; returns the failed row’s id.
fn counts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<Vec<QueueCount>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn failed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<Vec<FailedJob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn retry<'life0, 'async_trait>(
&'life0 self,
id: Option<i64>,
) -> Pin<Box<dyn Future<Output = CoreResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn retry<'life0, 'async_trait>(
&'life0 self,
id: Option<i64>,
) -> Pin<Box<dyn Future<Output = CoreResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Puts a failed job (or every one, with
None) back on its queue;
returns how many moved.Source§fn forget<'life0, 'async_trait>(
&'life0 self,
id: Option<i64>,
) -> Pin<Box<dyn Future<Output = CoreResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn forget<'life0, 'async_trait>(
&'life0 self,
id: Option<i64>,
) -> Pin<Box<dyn Future<Output = CoreResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drops a failed job (or every one, with
None); returns how many went.Auto Trait Implementations§
impl !RefUnwindSafe for DatabaseQueue
impl !UnwindSafe for DatabaseQueue
impl Freeze for DatabaseQueue
impl Send for DatabaseQueue
impl Sync for DatabaseQueue
impl Unpin for DatabaseQueue
impl UnsafeUnpin for DatabaseQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more