# `DripDrop.AdapterHealth`
[🔗](https://github.com/agoodway/dripdrop/blob/v0.1.0/lib/dripdrop/adapter_health.ex#L1)

Health-state transitions and ramp-cap math for outbound adapters.

# `effective_cap_today`

```elixir
@spec effective_cap_today(Ecto.Schema.t()) :: integer() | nil
```

Computes today's effective cap for an adapter.

# `evaluate_probe`

```elixir
@spec evaluate_probe(Ecto.Schema.t()) ::
  {:ok, Ecto.Schema.t()} | :ok | {:error, term()}
```

Evaluates one probing adapter for promotion or cooldown.

# `evaluate_probes`

```elixir
@spec evaluate_probes() :: {:ok, non_neg_integer()} | {:error, term()}
```

Evaluates all probing adapters.

# `recover_if_due`

```elixir
@spec recover_if_due(Ecto.Schema.t()) ::
  {:ok, Ecto.Schema.t()} | :ok | {:error, term()}
```

Moves a resting adapter into probing when its cooldown has elapsed.

# `set_external_signal`

```elixir
@spec set_external_signal(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}
```

Applies a host-supplied health signal to an adapter.

# `transition`

```elixir
@spec transition(Ecto.Schema.t(), atom() | nil, keyword() | map()) ::
  {:ok, Ecto.Schema.t(), [:state_changed_event]} | {:error, :invalid_transition}
```

Transitions an adapter to a new health state.

---

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