MessageQueue class

Buffers outgoing messages while the connection is down.

When the connection is restored, call drain to retrieve all valid (non-expired) messages and send them in order.

Constructors

MessageQueue({int maxSize = 100, Duration? messageTimeout})

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
no setter
isFull bool
Returns true when the queue has reached maxSize.
no setter
isNotEmpty bool
no setter
length int
no setter
maxSize int
final
messageTimeout Duration?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
drain() List<WebSocketMessage>
Removes and returns all non-expired messages. Expired messages are discarded.
enqueue(WebSocketMessage message) bool
Adds message to the queue. Returns false if the queue is full.
getStats() Map<String, dynamic>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeExpired() → void
Removes messages that have exceeded their messageTimeout.
toString() String
A string representation of this object.
inherited

Operators

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