Process-local queues for the callbacks deferred to the transaction boundary.
after_commit and after_rollback entries queue while a transaction is
open and run after the OUTERMOST commit or rollback, so a write nested in a
larger transaction gets its slot from the outcome that actually decided it.
When no transaction is open, "outermost" degrades to "pipeline success or
failure" and the entries run immediately, so arkes opted out of the
transaction keep both slots.
begin/0/finish/0 bracket every transaction the write pipeline opens;
whichever of commit/0/rollback/1 fires empties both queues.
Summary
Functions
Runs the queued after_commit entries oldest first — only when no
transaction is open. Entries are expected to isolate their own failures
(Arke.Hook.Pipeline.run_isolated/3).
Runs the queued after_rollback entries with the failure reason — only when
no transaction is open. Compensators undo in reverse order of the writes
that queued them, so the queue is drained newest first.
Functions
@spec begin() :: :ok
@spec commit() :: :ok
Runs the queued after_commit entries oldest first — only when no
transaction is open. Entries are expected to isolate their own failures
(Arke.Hook.Pipeline.run_isolated/3).
@spec depth() :: non_neg_integer()
@spec finish() :: :ok
@spec on_commit((-> any())) :: :ok
@spec rollback(any()) :: :ok
Runs the queued after_rollback entries with the failure reason — only when
no transaction is open. Compensators undo in reverse order of the writes
that queued them, so the queue is drained newest first.