Search documentation of macula

# macula_connection_pool (macula v0.44.2)

View Source

Connection 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(Pool)

Close all connections in the pool.

create_connection(Endpoint, NodeId, RealmId, Pool)

Create a new connection to an endpoint.

get_or_create_connection(Endpoint, NodeId, RealmId, Pool)

Get or create a connection to an endpoint. Returns {ok, Conn, Stream, UpdatedPool} or {error, Reason, Pool}.

# Functions

# close_all_connections(Pool)

    -spec close_all_connections(map()) -> ok.

Close all connections in the pool.

# create_connection(Endpoint, NodeId, RealmId, Pool)

    -spec create_connection(binary(), binary(), binary(), map()) ->
                               {ok, pid(), pid(), map()} | {error, term(), map()}.

Create a new connection to an endpoint.

# get_or_create_connection(Endpoint, NodeId, RealmId, Pool)

    -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}.