pub enum JobEvent<T> {
Started {
args: T,
job: JobRow,
},
WaitingForCallback {
args: T,
job: JobRow,
},
Completed {
args: T,
job: JobRow,
duration: Duration,
},
Retried {
args: T,
job: JobRow,
error: String,
attempt: i16,
next_run_at: DateTime<Utc>,
},
Exhausted {
args: T,
job: JobRow,
error: String,
attempt: i16,
},
Cancelled {
args: T,
job: JobRow,
reason: String,
},
Rescued {
args: T,
job: JobRow,
reason: RescueReason,
},
}Expand description
Typed lifecycle event for a specific job argument type.
Variants§
Started
Job execution started after the claim committed.
WaitingForCallback
Job parked waiting for an external callback. job.callback_id and
job.callback_timeout_at identify the pending callback.
Completed
Job completed successfully.
For a callback-driven completion duration is Duration::ZERO, since
no handler ran during the parked phase.
Retried
Job failed but will be retried later.
Exhausted
Job exhausted its retry budget and moved to failed.
Cancelled
Job was cancelled by the handler.
Rescued
Job was rescued by maintenance — either its callback wait expired,
its heartbeat went stale (presumed crashed worker), or its deadline
was exceeded. reason identifies the rescue path. The post-rescue
job.state is retryable when retries remain or failed when the
attempt that was rescued exhausted its retry budget.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for JobEvent<T>where
T: Freeze,
impl<T> RefUnwindSafe for JobEvent<T>where
T: RefUnwindSafe,
impl<T> Send for JobEvent<T>where
T: Send,
impl<T> Sync for JobEvent<T>where
T: Sync,
impl<T> Unpin for JobEvent<T>where
T: Unpin,
impl<T> UnsafeUnpin for JobEvent<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for JobEvent<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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