Phoenix Live-Reload v1.2.1 Phoenix.LiveReloader.Channel View Source

Phoenix’s live-reload channel.

Link to this section Summary

Functions

Handle regular Elixir process messages

Handle channel joins by topic

Link to this section Functions

Link to this function handle_info(arg, socket) View Source

Handle regular Elixir process messages.

See GenServer.handle_info/2.

Callback implementation for Phoenix.Channel.handle_info/2.

Link to this function join(binary, msg, socket) View Source

Handle channel joins by topic.

To authorize a socket, return {:ok, socket} or {:ok, reply, socket}. To refuse authorization, return {:error, reason}.

Example

def join("room:lobby", payload, socket) do
  if authorized?(payload) do
    {:ok, socket}
  else
    {:error, %{reason: "unauthorized"}}
  end
end

Callback implementation for Phoenix.Channel.join/3.