OffBroadwayWebSocket.ClientBehaviour behaviour (off_broadway_websocket v1.2.2)

Copy Markdown View Source

Behaviour describing the minimal client API used by the producer.

Providing your own module that implements this behaviour allows swapping out the WebSocket implementation in tests or alternative transports.

Summary

Callbacks

connect(url, path, gun_opts, await_timeout, headers)

@callback connect(
  url :: String.t(),
  path :: String.t(),
  gun_opts :: map(),
  await_timeout :: non_neg_integer(),
  headers :: [{String.t(), String.t()}]
) :: {:ok, %{conn_pid: pid(), stream_ref: reference()}} | {:error, term()}