IMessageReceiver class Null safety
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
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent 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