pub struct MemoryQueue { /* private fields */ }Expand description
An in-process queue.
Jobs live in this process’s memory, so they are lost when it stops and are invisible to any other process. Right for tests and for a single-process development server; use the database driver for anything that must survive a restart.
Implementations§
Source§impl MemoryQueue
impl MemoryQueue
Sourcepub fn failed_jobs(&self) -> Vec<FailedJob>
pub fn failed_jobs(&self) -> Vec<FailedJob>
Every job that has exhausted its attempts.
Sourcepub fn reserved_count(&self) -> usize
pub fn reserved_count(&self) -> usize
How many jobs are currently reserved by a worker.
Trait Implementations§
Source§impl Debug for MemoryQueue
impl Debug for MemoryQueue
Source§impl Default for MemoryQueue
impl Default for MemoryQueue
Source§fn default() -> MemoryQueue
fn default() -> MemoryQueue
Returns the “default value” for a type. Read more
Source§impl Queue for MemoryQueue
impl Queue for MemoryQueue
Source§fn reserve<'a>(
&'a self,
queue: &'a str,
) -> BoxFuture<'a, Result<Option<QueuedJob>>>
fn reserve<'a>( &'a self, queue: &'a str, ) -> BoxFuture<'a, Result<Option<QueuedJob>>>
Reserve the next available job on
queue, or None if there is none.Source§fn acknowledge<'a>(&'a self, job: &'a QueuedJob) -> BoxFuture<'a, Result<()>>
fn acknowledge<'a>(&'a self, job: &'a QueuedJob) -> BoxFuture<'a, Result<()>>
Remove a finished job.
Source§fn release<'a>(
&'a self,
job: &'a QueuedJob,
delay: Duration,
) -> BoxFuture<'a, Result<()>>
fn release<'a>( &'a self, job: &'a QueuedJob, delay: Duration, ) -> BoxFuture<'a, Result<()>>
Return a job to the queue for another attempt, available after
delay.Source§fn fail<'a>(
&'a self,
job: &'a QueuedJob,
error: &'a str,
) -> BoxFuture<'a, Result<()>>
fn fail<'a>( &'a self, job: &'a QueuedJob, error: &'a str, ) -> BoxFuture<'a, Result<()>>
Move a job to the failed store after its last attempt.
Auto Trait Implementations§
impl !Freeze for MemoryQueue
impl RefUnwindSafe for MemoryQueue
impl Send for MemoryQueue
impl Sync for MemoryQueue
impl Unpin for MemoryQueue
impl UnsafeUnpin for MemoryQueue
impl UnwindSafe for MemoryQueue
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
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.