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
listener
will be notified. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postMessage(
String channelName, SerializableEntity message, {bool global = false}) → void -
Posts a
message
to a named channel. Optionally adestinationServerId
can be provided, in which case the message is sent only to that specific server within the cluster. If nodestinationServerId
is 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