# `Parrhesia.Storage.Adapters.Postgres.Circuit`

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}`.

# `run_opt`

```elixir
@type run_opt() :: {:server, GenServer.server()} | {:fallback_error, term()}
```

# `allow`

```elixir
@spec allow(GenServer.server()) :: :ok | {:error, :storage_unavailable}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `mark_failure`

```elixir
@spec mark_failure(GenServer.server()) :: :ok
```

# `mark_success`

```elixir
@spec mark_success(GenServer.server()) :: :ok
```

# `run`

```elixir
@spec run((-&gt; term()), [run_opt()]) :: term()
```

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
