Interface for cleanup delivery queue storage.Implementations own cleanup message reservation correctness. WebSocket
dispatchers may keep process-local routing state, but ack, release, renew,
lease expiry, retry accounting, and DLQ transitions must go through this
queue. Implementations own the server retry and lease policy and completed
idempotency retention semantics.Methods:
Complete a reserved cleanup message.The operation must validate the work-pool scope and current reservation
token atomically before removing the message from active delivery.
Implementations should retain completed idempotency state according to
their configured retention policy.
Store a cleanup message if it has not already been produced.Implementations should treat message_id and idempotency_key as stable
producer identifiers within a work pool, returning the existing message
for repeated enqueue attempts instead of creating duplicates. The
optional work_queue_id is advisory targeting metadata.
Expire overdue reservations in bounded batches.Expired messages should become eligible for redelivery or move to the
dead-letter queue according to retry policy. Implementations may scope
the sweep to a work pool when work_pool_id is provided.
Read a dead-letter entry by work-pool scope and message ID.This is an inspection helper for terminal cleanup failures. It must not
return a dead-letter entry from a different work pool.
Read an active cleanup message by work-pool scope and message ID.This is an inspection helper for messages that have not been acked or
dead-lettered. It must not return a message from a different work pool.
Give up the current reservation without completing the cleanup message.The operation must validate the work-pool scope and current reservation
token atomically, then either make the message eligible for redelivery or
move it to the dead-letter queue when retry policy is exhausted.
Extend the lease for the current reservation.The operation must validate the work-pool scope and current reservation
token atomically. Renewing a reservation should not increment delivery
count because no new delivery has been committed.
Atomically reserve one eligible cleanup message for delivery.A successful reservation must increment the committed delivery count,
create exactly one active reservation, and return an unguessable token
required for follow-up operations. preferred_work_queue_ids should be
treated as an advisory preference, with pool-wide fallback controlled by
allow_fallback_to_any_queue.
Wait for a work-pool wakeup sequence newer than after.Returns the next wakeup when one is observed, or None when timeout
elapses before a newer wakeup is available.
Notify dispatchers that cleanup work may be available for a work pool.Implementations should advance and return a monotonic wakeup sequence so
local dispatchers can avoid missing notifications.