Class MessagePublisher
Represents a message publisher that allows subscribing to and publishing messages.
public class MessagePublisher
- Inheritance
-
MessagePublisher
- Inherited Members
Methods
Publish(MessageReader)
Publishes a message to all subscribed handlers.
public void Publish(MessageReader reader)
Parameters
reader
MessageReaderThe message reader containing the message to be published.
Subscribe(MessageType, Action<MessageReader>)
Subscribes to a specific message type with a handler.
public void Subscribe(MessageType type, Action<MessageReader> handler)
Parameters
type
MessageTypeThe message type to subscribe to.
handler
Action<MessageReader>The handler to be invoked when a message of the specified type is published.