PushEx.Behaviour.Socket behaviour (PushEx v2.1.0)

Implementable functions that are used in the flow of socket/channel creation. It is crucial to implement secure connect/join functions for all applications.

Link to this section Summary

Link to this section Callbacks

Link to this callback

channel_join(bitstring, map, t)

Specs

channel_join(bitstring(), map(), Phoenix.Socket.t()) ::
  {:ok, Phoenix.Socket.t()}
  | {:ok, reply :: map(), Phoenix.Socket.t()}
  | {:error, reason :: map()}

See Phoenix.Channel.join/3

Link to this callback

presence_identifier(t)

Specs

presence_identifier(Phoenix.Socket.t()) :: bitstring()

See Phoenix.Presence.track/4 key

Link to this callback

socket_connect(map, t)

Specs

socket_connect(map(), Phoenix.Socket.t()) :: {:ok, Phoenix.Socket.t()} | :error

See Phoenix.Socket.connect/3

Specs

socket_id(Phoenix.Socket.t()) :: bitstring()

See Phoenix.Socket.id/1