MessageCentral class

The MessageCentral handles communication within the server, and between servers in a cluster. It is especially useful when working with streaming endpoints. The message central can pass on any serializable to a channel. The channel can be listened to by from any place in the server.

Constructors

MessageCentral()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(Session session, String channelName, MessageCentralListenerCallback listener) → void
Adds a listener to a named channel. Whenever a message is posted using postMessage, the listener will be notified.
createStream<T>(Session session, String channelName) → Stream<T>
Creates a stream that listens to a specified channel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postMessage(String channelName, SerializableModel message, {MessageScope scope = MessageScope.auto}) → Future<bool>
Posts a message to a named channel. The scope determines whether the message is delivered locally within this server instance, globally across the cluster, or globally with a local fallback if Redis is not enabled (the default).
removeListener(Session session, String channelName, MessageCentralListenerCallback listener) → void
Removes a listener from a named channel.
removeListenersForSession(Session session) → void
Removes all listeners from the specified Session. This method is automatically called when the session is closed.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited