AsyncQueue class

AsyncQueue

a queue of async jobs that ensure those jobs will be execute in order, first come first serve

Constructors

AsyncQueue({bool allowDuplicate = true, bool throwIfDuplicate = false})
initialize normal queue
AsyncQueue.autoStart({bool? allowDuplicate, bool? throwIfDuplicate})
initialize auto queue
factory

Properties

allowDuplicate bool
allow to add multiple jobs with same label
final
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
true if the queue is closed, no more job can be added
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
current size of the queue
no setter
throwIfDuplicate bool
throw DuplicatedLabelException if duplicated job added
final

Methods

addJob(AsyncJob job, {Object? label, String? description, int retryTime = 1}) → void
Add new job into the queue
addJobThrow(AsyncJob job, {String? label, String? description, int retryTime = 1}) → void
Add new job in to the queue
addQueueListener(QueueListener listener) → void
Queue listener, emit event that indicate state of the queue
clear([Function? callBack]) → void
stop the queue and clear the history
close() → void
close the queue so that no more job can be added
currentJobUpdate(CurrentJobUpdater updater) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retry() → void
retry
start() Future<void>
to start the execution of jobs in queue
stop([Function? callBack]) → void
stop and remove all remain jobs in queue
toString() String
A string representation of this object.
inherited

Operators

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