Skip to main content

dequeue

Function dequeue 

Source
pub async fn dequeue(
    pool: &PgPool,
    now: i64,
    limit: u32,
) -> Result<Vec<QueuedMessage>, Error>
Expand description

fetch pending messages ready for delivery (legacy, non-atomic).

Returns rows in status = 'pending' without locking or marking them. Multi-worker setups using this then-mark_inflight flow can race on the same row and deliver twice. Prefer claim_for_delivery for any worker that may run with siblings. Kept for callers that only need a read snapshot.