Skip to content

Commit

Permalink
expand worker docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Nov 13, 2024
1 parent 4c2bec5 commit 13641c3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
//! input to an invocation of its execute method.
//!
//! As a task is being processed, the worker will assign various state
//! transitions to the task. Eventually the task will either be completed or
//! failed.
//! transitions to the task. Eventually the task will either succeed or fail.
//!
//! Also note that workers retry failed tasks in accordance with their
//! configured retry policies.
//! configured retry policies. When a task has remaining retries, it will be
//! requeued in a "pending" state.
//!
//! To ensure that only a single worker can process a task at a time, a
//! [transaction-level advisory lock][advisory-locks] is held over either the
//! task ID or concurrency key, if one is provided. In the case of the latter,
//! this ensures a serial processing property of the task.
//!
//! # Running workers
//!
Expand Down Expand Up @@ -116,6 +121,8 @@
//!
//! For cases where it's unimportant to wait for tasks to complete, this routine
//! can be ignored.
//!
//! [advisory-locks]: https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS

use std::{sync::Arc, time::Duration};

Expand Down

0 comments on commit 13641c3

Please sign in to comment.