API
Durable admission
Reserve / finish / cancel two-phase admission for producers that must not lose intent.
Durable admission is a queue-native reserve → finish / cancel state machine for producers that need a durable hold before the final enqueue payload is known (ADR-023).
from uuid import uuid4
handle = uuid4()
reservation = await tq.reserve_admission(
queue="ingest",
idempotency_key="upload-123",
intent_hash=intent_hash,
handle=handle,
)
# …prepare payload / side inputs…
await tq.finish_admission(
queue="ingest",
idempotency_key="upload-123",
handle=handle,
job={"job_type": "file.process", "payload": {"path": path}},
)
# or cancel with the same queue / key / handle
await tq.cancel_admission(
queue="ingest",
idempotency_key="upload-123",
handle=handle,
)
Why it exists
Plain enqueue is reject-only on uniqueness races. Admission lets a producer claim a durable slot, then finish into a real job or cancel without inventing a second outbox table.
Shipped in migration 0007_admission_reservations.sql and retained in the
current SQL contract, 0.6.6.