Phoenix.Socket.Message
Phoenix.Socket.Message
Defines a message dispatched over transport to channels and vice-versa.
The message format requires the following keys:
-
topic
- The string topic or topic:subtopic pair namespace, for example “messages”, “messages:123” -
event
- The string event name, for example “phx_join” -
payload
- The message payload -
ref
- The unique string ref
Summary
Types
Functions
- from_map!(map)
-
Converts a map with string keys into a message struct
Types
t :: %Phoenix.Socket.Message{event: term, payload: term, ref: term, topic: term}
Functions
from_map!(map)
Converts a map with string keys into a message struct.
Raises Phoenix.Socket.InvalidMessageError
if not valid.
© 2014 Chris McCord
Licensed under the MIT License.
https://hexdocs.pm/phoenix/Phoenix.Socket.Message.html