Encodes realtime channel event payloads as protobuf for sockets connected
with ?format=protobuf (see proto/gamend_realtime.proto, the wire
contract shared with all clients).
encode/3 is the single source of truth for the event → message mapping.
Events without a mapping return :json and are delivered as regular JSON,
so protobuf coverage can grow event by event without breaking clients.
Transforms relative to the JSON payloads (documented in the proto file): timestamps become unix milliseconds, arbitrary JSON values (metadata, KV data) become JSON-encoded bytes.
Summary
Functions
Encodes payload for event pushed on topic.