Parrhesia.Storage.Adapters.Postgres.Circuit
(parrhesia v0.12.0)
Copy Markdown
Lightweight fast-fail guard for PostgreSQL connectivity incidents.
The guard opens after consecutive connection failures and temporarily rejects
new DB-backed operations with {:error, :storage_unavailable}.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type run_opt() :: {:server, GenServer.server()} | {:fallback_error, term()}
Functions
@spec allow(GenServer.server()) :: :ok | {:error, :storage_unavailable}
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec mark_failure(GenServer.server()) :: :ok
@spec mark_success(GenServer.server()) :: :ok
@spec start_link(keyword()) :: GenServer.on_start()