Skip to content
Discussion options

You must be logged in to vote

Thanks for the kind words—and for digging into this!

Under the hood, the QueueManager uses two mechanisms to decide when to pull jobs:

  1. LISTEN/NOTIFY wakes it up immediately when you NOTIFY the channel after enqueueing.
  2. A periodic poll every dequeue_timeout to look for work that’s become ready (i.e. jobs whose execute_after timestamp has just passed).

Why we need that periodic poll

Postgres’s LISTEN/NOTIFY is a best-effort broadcast, not a guaranteed message queue. Missing notifications can occur if the listener temporarily disconnects (for example, during a network hiccup or failover). The dequeue_timeout safety-net ensures that, even if a notification is dropped or delayed, the manage…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@briantsaunders
Comment options

Answer selected by briantsaunders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants