pub struct CurrentJob { /* private fields */ }
Expand description
Handle to the currently executing job.
When dropped, the job is assumed to no longer be running.
To prevent the job being retried, it must be explicitly completed using
one of the .complete_
methods.
Implementations§
Source§impl CurrentJob
impl CurrentJob
Sourcepub async fn complete_with_transaction(
&mut self,
tx: Transaction<'_, Postgres>,
) -> Result<(), Error>
pub async fn complete_with_transaction( &mut self, tx: Transaction<'_, Postgres>, ) -> Result<(), Error>
Complete this job and commit the provided transaction at the same time. If the transaction cannot be committed, the job will not be completed.
Sourcepub async fn checkpoint_with_transaction(
&mut self,
tx: Transaction<'_, Postgres>,
checkpoint: &Checkpoint<'_>,
) -> Result<(), Error>
pub async fn checkpoint_with_transaction( &mut self, tx: Transaction<'_, Postgres>, checkpoint: &Checkpoint<'_>, ) -> Result<(), Error>
Checkpoint this job and commit the provided transaction at the same time. If the transaction cannot be committed, the job will not be checkpointed. Checkpointing allows the job payload to be replaced for the next retry.
Sourcepub async fn checkpoint(
&mut self,
checkpoint: &Checkpoint<'_>,
) -> Result<(), Error>
pub async fn checkpoint( &mut self, checkpoint: &Checkpoint<'_>, ) -> Result<(), Error>
Checkpointing allows the job payload to be replaced for the next retry.
Sourcepub async fn keep_alive(&mut self, duration: Duration) -> Result<(), Error>
pub async fn keep_alive(&mut self, duration: Duration) -> Result<(), Error>
Prevent this job from being retried for the specified interval.
Trait Implementations§
Source§impl Debug for CurrentJob
impl Debug for CurrentJob
Auto Trait Implementations§
impl Freeze for CurrentJob
impl !RefUnwindSafe for CurrentJob
impl Send for CurrentJob
impl Sync for CurrentJob
impl Unpin for CurrentJob
impl !UnwindSafe for CurrentJob
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> 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>
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