livery_client_circuit_store (livery v0.2.0)
View SourceOwns the ETS table backing the client circuit breakers.
A gen_server that creates a public named table at startup and clears it
on shutdown; the decision logic in livery_client_circuit reads and
writes the table directly (no per-request round trip through this
process). One row per breaker name: {Name, Status, Fails, Total, OpenedAtMs} where Status is closed | open | half_open.
Summary
Functions
May a request pass? Half-opens an expired-cooldown breaker to probe.
Record a request outcome and update the breaker state.
Forget a breaker's state.
Types
Functions
-spec allow(term(), non_neg_integer()) -> allow | deny.
May a request pass? Half-opens an expired-cooldown breaker to probe.
-spec init([]) -> {ok, state()}.
-spec record(term(), ok | err, pos_integer(), float()) -> ok.
Record a request outcome and update the breaker state.
-spec reset(term()) -> ok.
Forget a breaker's state.