Gust.DBLocker behaviour (gust v0.1.26)
Behaviour for acquiring a DB-backed lock (e.g. Postgres advisory lock).
Implementations must return true if the lock was acquired, false otherwise.
Summary
Types
Function to execute if the lock is acquired
Lock identifier (e.g. integer key, string name, tuple, etc.)
Types
Callbacks
@callback try_lock(lock_key(), attempt_result_fun()) :: boolean()
Functions
@spec try_lock(lock_key(), attempt_result_fun()) :: boolean()