Validated configuration for a running Zizq client.
Built once when the client starts and read on every request, so it is
kept in :persistent_term rather than behind a process. A lookup is
then a direct memory read with no message pass on the hot path.
Summary
Functions
Remove a stored config, so repeated start/stop cycles don't accumulate.
Look up the config for a running client.
Validate raw options and build a config struct.
Store the config for name. Called by the supervisor at startup.
The base URL as a string, for logs and messages.
Types
@type t() :: %Zizq.Config{ codec: Zizq.Codec.t(), connect_timeout: timeout(), finch_name: atom(), name: atom(), pool_count: pos_integer(), receive_timeout: timeout(), recorder: term(), ssl_opts: keyword(), stream_idle_timeout: timeout(), uri: URI.t() }
Functions
Remove a stored config, so repeated start/stop cycles don't accumulate.
Look up the config for a running client.
Raises with an actionable message if the client isn't running, which is by far the most common way to get this wrong.
Validate raw options and build a config struct.
Raises NimbleOptions.ValidationError on invalid options, or
ArgumentError for a malformed URL or unknown codec.
@spec put(t()) :: :ok
Store the config for name. Called by the supervisor at startup.
The base URL as a string, for logs and messages.