View Source Incident.EventStore.Postgres.LockManager (incident v0.6.2)
Manages aggregate locks for the Postgres adapter.
The Lock Manager can be configured during initialization for the retry logic and lock timeout.
Link to this section Summary
Functions
Attempts to acquire a lock for the aggregate id. It uses the lock manager configuration for retry logic. In case the lock can't be acquired after all retry attempts, it will return an error.
Returns a specification to start this module under a supervisor.
Removes the lock for the aggregate id that belongs to the caller.
Link to this section Types
Link to this section Functions
@spec acquire_lock(aggregate_id(), pid()) :: lock_acquisition_response()
Attempts to acquire a lock for the aggregate id. It uses the lock manager configuration for retry logic. In case the lock can't be acquired after all retry attempts, it will return an error.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec release_lock(aggregate_id(), pid()) :: :ok
Removes the lock for the aggregate id that belongs to the caller.
@spec start_link(keyword()) :: GenServer.on_start()