pub struct QueuedJob {
pub name: String,
pub payload: Json,
pub queue: String,
pub max_tries: u32,
pub retry_after: Duration,
pub delay: Duration,
}Expand description
A job as it is stored: a name, a payload, and the policy for running it.
Everything past the dispatch call deals in this rather than in a concrete
type, which is what keeps the Queue trait dyn-compatible.
Fields§
§name: String§payload: Json§queue: String§max_tries: u32§retry_after: Duration§delay: DurationHow long after being pushed the job becomes visible to a worker.
Implementations§
Source§impl QueuedJob
impl QueuedJob
Sourcepub fn new(name: impl Into<String>, payload: Json) -> Self
pub fn new(name: impl Into<String>, payload: Json) -> Self
An envelope built by hand, for a caller that has a name and a payload but no Rust type — a job pushed by another service, say.
pub fn on_queue(self, queue: impl Into<String>) -> Self
pub fn with_delay(self, delay: Duration) -> Self
pub fn with_tries(self, tries: u32) -> Self
pub fn with_retry_after(self, retry_after: Duration) -> Self
Trait Implementations§
impl StructuralPartialEq for QueuedJob
Auto Trait Implementations§
impl Freeze for QueuedJob
impl RefUnwindSafe for QueuedJob
impl Send for QueuedJob
impl Sync for QueuedJob
impl Unpin for QueuedJob
impl UnsafeUnpin for QueuedJob
impl UnwindSafe for QueuedJob
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