ska_dlm.dlm_outbox.outbox

Transactional outbox operations for DLM.

This module provides the lightweight database operations needed by the transactional outbox relay. The helper functions are intentionally small and designed to be called within an async SQLAlchemy transaction.

Functions

add_outbox_event(session, event_type, payload)

Insert a new outbox event in the database.

delete_old_sent_outbox_events(session[, cutoff])

Delete sent outbox events older than the provided retention cutoff.

get_pending_outbox_events(session[, limit])

Return pending outbox events ordered by creation time.

mark_outbox_event_failed(session, outbox_id)

Mark an outbox event as failed and record the last attempt timestamp.

mark_outbox_event_sent(session, outbox_id[, ...])

Mark an outbox event as sent and increment the attempt counter.