Struct sqlxmq::CurrentJob [−][src]
pub struct CurrentJob { /* fields omitted */ }
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
pub 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.
pub 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.
Checkpointing allows the job payload to be replaced for the next retry.
Prevent this job from being retried for the specified interval.
Extracts the JSON payload belonging to this job (if present).