RequestQueue class

Manages a FIFO queue of network requests that should be replayed when the device regains connectivity.

The queue itself does NOT listen for connectivity — that is the responsibility of SyncEngine which calls processQueue at the right time.

Constructors

RequestQueue({QueueStore? store, NetworkLogger? logger})
Creates a RequestQueue.

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether the queue is empty.
no setter
isProcessing bool
Whether the queue is currently being drained.
no setter
length int
Number of requests waiting.
no setter
pending List<QueuedRequest>
All queued requests (read-only snapshot).
no setter
resultStream Stream<QueueProcessResult>
Stream that emits a QueueProcessResult for every request processed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Discard all queued requests.
dispose() Future<void>
Dispose resources.
enqueue(QueuedRequest request) → void
Enqueue a new request.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processQueue({void onProgress(int completed, int total)?}) Future<List<QueueProcessResult>>
Process all queued requests sequentially.
remove(String id) bool
Remove a specific request by id.
toString() String
A string representation of this object.
inherited

Operators

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