macula_connection_pool (macula v0.20.5)
View SourceConnection pool manager for endpoint connections.
Manages a pool of QUIC connections to remote endpoints, providing connection caching and reuse to avoid connection overhead for multi-endpoint RPC operations.
Connection pool structure: #{Endpoint => #{connection => Conn, stream => Stream, last_used => Timestamp}}
Summary
Functions
Close all connections in the pool.
Create a new connection to an endpoint.
Get or create a connection to an endpoint. Returns {ok, Conn, Stream, UpdatedPool} or {error, Reason, Pool}.
Functions
-spec close_all_connections(map()) -> ok.
Close all connections in the pool.
-spec create_connection(binary(), binary(), binary(), map()) -> {ok, pid(), pid(), map()} | {error, term(), map()}.
Create a new connection to an endpoint.
-spec get_or_create_connection(binary(), binary(), binary(), map()) -> {ok, pid(), pid(), map()} | {error, term(), map()}.
Get or create a connection to an endpoint. Returns {ok, Conn, Stream, UpdatedPool} or {error, Reason, Pool}.