barrel_mcp_client_transport behaviour (barrel_mcp v3.0.1)
View SourceTransport behaviour for barrel_mcp_client.
A transport owns the underlying socket/port/process and forwards inbound JSON-RPC messages to the owning client gen_statem. The client never reads the wire directly; it only sends/closes through this behaviour and consumes asynchronous messages of the form:
{mcp_in: TransportPid, JsonBinary}, one decoded JSON-RPC envelope arrived from the peer.{mcp_closed: TransportPid, Reason}, the transport ended (peer hung up, port exited, etc.).
Transports MUST deliver one envelope per mcp_in message; framing (line splitting, SSE parsing) is the transport's responsibility.
Summary
Functions
Ask the transport to cancel one request. unsupported when it has no per-request channel; the caller then sends the notification.
Convenience wrapper to close any transport handle.
Convenience wrapper to send through any transport handle.
Types
Callbacks
Functions
Ask the transport to cancel one request. unsupported when it has no per-request channel; the caller then sends the notification.
-spec close(t()) -> ok.
Convenience wrapper to close any transport handle.
Convenience wrapper to send through any transport handle.