phoenix_gen_socket_client v1.0.0 Phoenix.Channels.GenSocketClient.Transport behaviour

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.

Summary

Callbacks

Invoked to push the frame

Invoked from the socket process to start the transport process

Types

frame :: {:text | :binary, GenSocketClient.encoded_message}
transport_pid :: pid

Callbacks

push(transport_pid, frame)

Specs

push(transport_pid, frame) :: :ok

Invoked to push the frame.

start_link(url, arg1)

Specs

start_link(url :: String.t, GenSocketClient.transport_opts) ::
  {:ok, transport_pid} |
  {:error, any}

Invoked from the socket process to start the transport process.