Railway IPC UI v0.0.3 RailwayUiWeb.UserSocket View Source
Link to this section Summary
Link to this section Functions
Callback implementation for Phoenix.Socket.connect/3
.
Identifies the socket connection.
Socket IDs are topics that allow you to identify all sockets for a given user:
def id(socket), do: "users_socket:#{socket.assigns.user_id}"
Would allow you to broadcast a "disconnect"
event and terminate
all active sockets and channels for a given user:
MyApp.Endpoint.broadcast("users_socket:" <> user.id, "disconnect", %{})
Returning nil
makes this socket anonymous.
Callback implementation for Phoenix.Socket.id/1
.