IMessageReceiver class abstract

Callback interface to receive incoming messages.

Example

class MyMessageReceiver implements IMessageReceiver {
  Future receiveMessage(MessageEnvelop envelope, IMessageQueue queue) async {
      print("Received message: " + envelop.getMessageAsString());
  }
}

var messageQueue =  MemoryMessageQueue();
messageQueue.listen("123", MyMessageReceiver());

await messageQueue.open("123")

messageQueue.send("123", MessageEnvelop(null, "mymessage", "ABC")); // Output in console: "ABC"
Implementers

Constructors

IMessageReceiver()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
receiveMessage(MessageEnvelope envelope, IMessageQueue queue) Future
Receives incoming message from the queue.
toString() String
A string representation of this object.
inherited

Operators

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