Phoenix.Socket.Message
Defines a Phoenix.Socket Message dispatched over channels.
The Message format requires the following keys:
- topic - The String topic or topic:subtopic pair namespace, ie “messages”, “messages:123”
- event - The String event name, ie “join”
- payload - The String JSON message payload
Summary↑
| from_map!(map) | Converts a map with string keys into a |
| parse!(text) | Parse JSON into required format
Raises |
Functions
Converts a map with string keys into a %Phoenix.Socket.Message{}.
Raises Phoenix.Socket.Message.InvalidMessage if not valid
See parse!/1 for required keys
Parse JSON into required format
Raises Phoenix.Socket.Message.InvalidMessage if invalid
Returns The %Phoenix.Socket.Message{} parsed from JSON