Two Phase Commit v0.1.0 Traktor.Store behaviour View Source
The store specification.
The store is responsible for persisting the state and transactions of an entity and enforces the constraints to apply transactions sequentially.
A store used in the two-phase-commit approch must export hte following three functions:
prepare/4
function which persists the prepared transaction;commit/3
function which persit the updated state;get/2
function which retrieves the current state of an entity with an optional pending transaction.
Link to this section Summary
Types
Module implementing the Traktor.Action
behaviour
Store error
Unique reference of an entity
The revision of the state of an entity
The state of an entity at a specific revision
Module implementing the Traktor.Store
behaviour
A transaction contains all the information required to commit an action
Unique reference of a transaction
Link to this section Types
Module implementing the Traktor.Action
behaviour.
Store error.
Unique reference of an entity.
The revision of the state of an entity.
The state of an entity at a specific revision.
Module implementing the Traktor.Store
behaviour.
A transaction contains all the information required to commit an action.
Unique reference of a transaction.
Link to this section Callbacks
commit(ref(), transaction_ref(), state()) :: {:ok, revision()} | on_error()
get(ref()) :: {:ok, revision(), state()} | {:pending, state(), action(), transaction(), transaction_ref()}
prepare(ref(), revision(), module(), transaction()) :: {:ok, transaction_ref()} | on_error()