pub struct Queue { /* private fields */ }Expand description
Queue for managing jobs
Implementations§
Source§impl Queue
impl Queue
pub fn new(backend: Arc<dyn QueueBackend>) -> Self
pub fn memory() -> Self
pub async fn enqueue(&self, job: JobWrapper) -> Result<String>
pub async fn dequeue(&self) -> Result<Option<JobWrapper>>
pub async fn complete(&self, job_id: &str) -> Result<()>
pub async fn fail(&self, job_id: &str, error: String) -> Result<()>
pub async fn retry(&self, job: JobWrapper) -> Result<()>
pub async fn move_to_dead_letter(&self, job: JobWrapper) -> Result<()>
pub async fn list_dead_letter(&self) -> Result<Vec<JobWrapper>>
pub async fn retry_from_dead_letter(&self, job_id: &str) -> Result<()>
pub async fn get_stats(&self) -> QueueStats
Auto Trait Implementations§
impl Freeze for Queue
impl !RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl !UnwindSafe for Queue
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> 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