pub struct QueuedJob {
pub id: String,
pub name: String,
pub payload: Value,
pub queue: String,
pub attempts: u32,
pub max_attempts: u32,
pub available_at: DateTime<Utc>,
pub created_at: DateTime<Utc>,
pub unique_key: Option<String>,
}Expand description
A job serialised for the queue.
Fields§
§id: StringA unique id for this queued instance.
name: StringThe Job::NAME the registry resolves.
payload: ValueThe job’s serialised body.
queue: StringWhich queue it is on.
attempts: u32How many times it has been attempted.
max_attempts: u32How many attempts it gets.
available_at: DateTime<Utc>The earliest it may run — how delays are expressed.
created_at: DateTime<Utc>When it was enqueued.
unique_key: Option<String>The uniqueness lock this job holds, if it declared a
unique_id.
Carried on the job rather than kept by the dispatcher, because the
process that releases it is a worker, in another process, minutes
later. None for the ordinary case.
Implementations§
Source§impl QueuedJob
impl QueuedJob
Sourcepub fn delayed_by(self, delay: Duration) -> Self
pub fn delayed_by(self, delay: Duration) -> Self
Hold it back for delay.
Sourcepub fn available_at(self, at: DateTime<Utc>) -> Self
pub fn available_at(self, at: DateTime<Utc>) -> Self
Make it available no earlier than at.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Whether it may run now.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Whether every attempt has been used.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for QueuedJob
impl<'de> Deserialize<'de> for QueuedJob
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.