ExUtcp.Transports.Mcp.Pool (ex_utcp v0.3.2)

Copy Markdown View Source

Manages a pool of MCP connections for efficient resource usage.

Summary

Functions

Returns a specification to start this module under a supervisor.

Closes all connections.

Closes a specific connection.

Gets a connection for the given provider.

Starts the MCP connection pool.

Gets pool statistics.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close_all_connections()

@spec close_all_connections() :: :ok

Closes all connections.

close_connection(pid)

@spec close_connection(pid()) :: :ok

Closes a specific connection.

get_connection(provider)

@spec get_connection(ExUtcp.Types.mcp_provider()) ::
  {:ok, pid()} | {:error, String.t()}

Gets a connection for the given provider.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the MCP connection pool.

stats()

@spec stats() :: map()

Gets pool statistics.