pub struct QueueJob {Show 13 fields
pub queue: String,
pub id: String,
pub body: String,
pub attempts: u32,
pub max_attempts: u32,
pub status: QueueJobStatus,
pub available_at_ms: i64,
pub leased_at_ms: Option<i64>,
pub lease_expires_at_ms: Option<i64>,
pub completed_at_ms: Option<i64>,
pub dead_at_ms: Option<i64>,
pub created_at: String,
pub last_error: String,
}Expand description
A queued unit of work.
Fields§
§queue: StringQueue name.
id: StringStable job identifier.
body: StringSerialized job payload.
attempts: u32Number of attempts already made.
max_attempts: u32Maximum attempts before the job should be considered dead.
status: QueueJobStatusCurrent job status.
available_at_ms: i64Unix timestamp in milliseconds when this job becomes claimable.
leased_at_ms: Option<i64>Unix timestamp in milliseconds when this job was leased.
lease_expires_at_ms: Option<i64>Unix timestamp in milliseconds when this job lease expires.
completed_at_ms: Option<i64>Unix timestamp in milliseconds when this job completed.
dead_at_ms: Option<i64>Unix timestamp in milliseconds when this job moved to dead-letter state.
created_at: StringISO 8601 creation timestamp. Empty if not set.
last_error: StringError message from last nack. Empty if not set.
Implementations§
Source§impl QueueJob
impl QueueJob
Sourcepub fn new(
queue: impl Into<String>,
id: impl Into<String>,
body: impl Into<String>,
max_attempts: u32,
) -> Self
pub fn new( queue: impl Into<String>, id: impl Into<String>, body: impl Into<String>, max_attempts: u32, ) -> Self
Create a new ready job.
Sourcepub fn delay_by_ms(self, delay_ms: u64) -> Self
pub fn delay_by_ms(self, delay_ms: u64) -> Self
Make this job available after a delay.
Sourcepub const fn available_at_ms(self, available_at_ms: i64) -> Self
pub const fn available_at_ms(self, available_at_ms: i64) -> Self
Set the exact Unix timestamp in milliseconds when this job is claimable.
Trait Implementations§
impl Eq for QueueJob
impl StructuralPartialEq for QueueJob
Auto Trait Implementations§
impl Freeze for QueueJob
impl RefUnwindSafe for QueueJob
impl Send for QueueJob
impl Sync for QueueJob
impl Unpin for QueueJob
impl UnsafeUnpin for QueueJob
impl UnwindSafe for QueueJob
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