SequentialWorkQueue class

A utility class that will process work giving to it in order, without failure.

It is guaranteed under a standard Zone that all work will be processed, whether previous works fails or not.

Constructors

SequentialWorkQueue()

Properties

hashCode int
The hash code for this object.
no setterinherited
insideSequentialWorkQueue bool
Checks whether the current code is running inside this SequentialWorkQueue work callback via add.
no setter
isEmpty bool
Whether this queue is empty
no setter
isNotEmpty bool
Whether this queue is not empty
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add<T extends Object?>(FutureOr<T> work(), {FutureOr<bool> onCancel()?, bool waitForMicrotasks = true, bool waitForTimers = false, bool waitForPeriodicTimers = false}) Future<T?>
Add work to this SequentialWorkQueue. It will be executed when all previous work registered to the SequentialWorkQueue as completed.
clear() Future<void>
Clear the queue. This will attempt to cancel all work pending and running. It will return when all work has truly completed or cancelled.
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