ChannelClient.Transport behaviour (channel_client v0.1.0)

Copy Markdown

Behaviour for socket transports used by ChannelClient.Socket.

A transport is responsible for opening the underlying connection and shuttling raw (already serialized) frames in both directions. Frames received from the remote end are sent to the socket as {:receive, payload}, outbound frames arrive as {:send, payload} messages to the process returned by open/2.

Summary

Callbacks

close(socket)

@callback close(socket :: pid()) :: {:ok, any()} | {:error, any()}

open(url, opts)

@callback open(url :: String.t(), opts :: Keyword.t()) :: {:ok, pid()} | {:error, any()}