# `Foundation.CircuitBreaker.Registry`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L1)

ETS-based registry for circuit breaker state.

# `registry`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L11)

```elixir
@type registry() :: :ets.tid() | atom()
```

# `call`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L48)

```elixir
@spec call(String.t(), (-&gt; result)) :: result | {:error, :circuit_open}
when result: term()
```

Execute a function through a named circuit breaker using the default registry with default options.

# `call`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L57)

```elixir
@spec call(registry(), String.t(), (-&gt; result), keyword()) ::
  result | {:error, :circuit_open}
when result: term()
```

Execute a function through a named circuit breaker.

# `default_registry`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L17)

```elixir
@spec default_registry() :: registry()
```

Return the default registry (anonymous ETS table).

# `delete`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L97)

```elixir
@spec delete(registry(), String.t()) :: :ok
```

Delete a circuit breaker from the registry.

# `list`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L107)

```elixir
@spec list(registry()) :: [{String.t(), Foundation.CircuitBreaker.state()}]
```

List all circuit breakers and their states.

# `new_registry`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L25)

```elixir
@spec new_registry(keyword()) :: registry()
```

Create a new registry. Use `name: :my_table` for a named ETS table.

# `reset`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L84)

```elixir
@spec reset(registry(), String.t()) :: :ok
```

Reset a circuit breaker to closed state.

# `state`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/circuit_breaker/registry.ex#L73)

```elixir
@spec state(registry(), String.t()) :: Foundation.CircuitBreaker.state()
```

Get the current state of a circuit breaker.

---

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