OutboundQueue class
A serialized, byte-bounded outbound send queue.
Messages are sent one at a time (each add waits for the previous send to
complete), which both preserves ordering and provides a natural
back-pressure point: when a consumer is slow, its onSend futures complete
slowly and the queued byte count grows. If the queued (not-yet-sent) bytes
would exceed maxBufferSize, add rejects with OutboundBufferOverflow
instead of buffering without bound.
Constructors
-
OutboundQueue({required Future<
void> onSend(List<int> data), required int maxBufferSize}) - A serialized, byte-bounded outbound send queue.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the queue has been closed (manually or by an overflow).
no setter
- pendingBytes → int
-
Bytes currently queued and waiting to be sent.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
List< int> data) → Future<void> -
Enqueue
datafor sending. -
close(
) → void - Close the queue. Subsequent add calls throw and queued (not-yet-sent) messages are dropped.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited