Health-state transitions and ramp-cap math for outbound adapters.
Summary
Functions
Computes today's effective cap for an adapter.
Evaluates one probing adapter for promotion or cooldown.
Evaluates all probing adapters.
Moves a resting adapter into probing when its cooldown has elapsed.
Applies a host-supplied health signal to an adapter.
Transitions an adapter to a new health state.
Functions
@spec effective_cap_today(Ecto.Schema.t()) :: integer() | nil
Computes today's effective cap for an adapter.
@spec evaluate_probe(Ecto.Schema.t()) :: {:ok, Ecto.Schema.t()} | :ok | {:error, term()}
Evaluates one probing adapter for promotion or cooldown.
@spec evaluate_probes() :: {:ok, non_neg_integer()} | {:error, term()}
Evaluates all probing adapters.
@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.
@spec set_external_signal(Ecto.UUID.t(), map()) :: {:ok, Ecto.Schema.t()} | {:error, term()}
Applies a host-supplied health signal to an adapter.
@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.