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
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
listenerwill 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, {bool global = false}) → Future< bool> -
Posts a
messageto a named channel. Optionally adestinationServerIdcan be provided, in which case the message is sent only to that specific server within the cluster. If nodestinationServerIdis provided, the message is passed on to all servers in the cluster. -
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 StreamingSession is closed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited