phoenix_gen_socket_client v2.0.0 Phoenix.Channels.GenSocketClient.Transport behaviour View Source

Transport contract used by Phoenix.Channels.GenSocketClient

The implementation has following responsibilities:

  • Starts the transport process and links it to the caller. It is always assumed that the caller process is the socket process.
  • Pushes messages to the server when the push/2 function is invoked.
  • Notifies the socket process about various events by invoking notify_* functions from the Phoenix.Channels.GenSocketClient module.

Link to this section Summary

Callbacks

Invoked to push the frame

Invoked from the socket process to start the transport process

Link to this section Types

Link to this type frame() View Source
frame() :: {:text | :binary, GenSocketClient.encoded_message}
Link to this type transport_pid() View Source
transport_pid() :: pid

Link to this section Callbacks

Link to this callback push(transport_pid, frame) View Source
push(transport_pid, frame) :: :ok

Invoked to push the frame.

Link to this callback start_link(url, arg1) View Source
start_link(url :: String.t, GenSocketClient.transport_opts) ::
  {:ok, transport_pid} |
  {:error, any}

Invoked from the socket process to start the transport process.