Movie::Remote::MessageRegistry
MessageRegistry manages serialization and deserialization of message types. Message types must be registered before they can be sent over the wire.
Class methods
Deserializes a message from its tag and JSON payload. Raises if the tag is not registered.
Internal method to register type handlers.
Serializes a message, returning {tag, json_payload}. The type must include JSON::Serializable.
Macros
register(type, tag = nil)
Registers a message type with optional custom tag. The type must include JSON::Serializable.
Example: MessageRegistry.register(MyMessage) MessageRegistry.register(MyMessage, "custom-tag")