HttpPool (fnord v0.8.83)
View SourceProvides a per-process HTTP pool override mechanism for Hackney pools.
By default, calls to HTTP clients will use the :ai_api pool. Processes such
as background indexers can override this setting locally, ensuring their
HTTP requests are routed through a dedicated :ai_indexer pool without
affecting other processes.
Summary
Functions
Clears any HTTP pool override in the current process, reverting to default.
Returns the current process HTTP pool override, defaulting to :ai_api.
Overrides the HTTP pool for the current process.
Temporarily sets the HTTP pool override for the duration of the given function.
Functions
@spec clear() :: :ok
Clears any HTTP pool override in the current process, reverting to default.
@spec get() :: atom()
Returns the current process HTTP pool override, defaulting to :ai_api.
@spec set(atom()) :: :ok
Overrides the HTTP pool for the current process.
Examples
HttpPool.set(:ai_indexer)
Temporarily sets the HTTP pool override for the duration of the given function.
The pool override is restored to its previous value after the function returns or raises.