Struct sqlxmq::CurrentJob
source · 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 !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