pub struct SyncQueue { /* private fields */ }Expand description
A queue that runs jobs immediately, on the thread that dispatched them.
Not really a queue: nothing is stored and nothing is deferred. It exists so
an application can be developed and tested without a worker process, which
is what QUEUE_DRIVER=sync selects. A job dispatched
this way fails the dispatching request if it fails, which is exactly the
behaviour queueing exists to avoid — so never use it in production.
Implementations§
Trait Implementations§
Source§impl Queue for SyncQueue
impl Queue for SyncQueue
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 !RefUnwindSafe for SyncQueue
impl !UnwindSafe for SyncQueue
impl Freeze for SyncQueue
impl Send for SyncQueue
impl Sync for SyncQueue
impl Unpin for SyncQueue
impl UnsafeUnpin for SyncQueue
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.