Expand description
Queue row type, status enum, and retry-attempt bookkeeping.
Structs§
- Queued
Message - One queued outbound message — the full row stored in the outbound queue.
Enums§
- Queue
Status - Lifecycle status of a queued message.
Functions§
- add_
suppression - add a recipient to the suppression list after a hard bounce
- cancel_
pending - cancel a pending outbound message (undo send)
- cancel_
pending_ by_ message_ id - cancel a pending outbound message by message_id (undo send)
- claim_
for_ delivery - Atomically claim up to
limitpending messages and transition them toinflight, returning the claimed rows. - count_
inflight - Count of rows in
status = 'inflight'(currently being delivered by a worker). Used alongsidecount_pendingso dashboards can show both “queued” and “in-flight” depth. - count_
pending - Count of rows in
status = 'pending'(anynext_retry). Used by the delivery worker to publish amailrs_outbound_queue_depthgauge per poll tick. O(rows) but cheap with thestatusindex. - dequeue
- fetch pending messages ready for delivery (legacy, non-atomic).
- enqueue
- enqueue a message for outbound delivery
- enqueue_
ex - enqueue a message for outbound delivery with forwarding flag
- enqueue_
scheduled - enqueue a message for scheduled delivery at a future time
- get_
message - get a specific queued message by id
- is_
hard_ bounce - detect if an SMTP error is a permanent/hard bounce (5xx)
- is_
suppressed - check if a recipient address is in the suppression list (hard bounce)
- list_
recent - list recent queue entries for admin UI
- list_
suppressions - list all suppressed addresses
- mark_
bounced - mark a message as permanently bounced
- mark_
delivered - mark a message as delivered
- mark_
failed - mark a message as failed with next retry time
- mark_
inflight - mark a message as in-flight
- notify
- notify the delivery worker that new messages are queued via the
in-process kevy
queue:notifychannel. - queue_
stats - get queue statistics
- recover_
stale_ inflight - recover messages stuck in inflight status for more than 10 minutes (worker crashed or was killed before marking them as delivered/failed)
- remove_
suppression - remove an address from the suppression list (admin override)
- retry_
message - reset a bounced/failed message back to pending for retry