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.
read-onlyinherited
isClosed bool
true if the queue is closed, no more job can be added
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
size int
current size of the queue
read-only
throwIfDuplicate bool
throw DuplicatedLabelException if duplicated job added
final

Methods

addJob(AsyncJob job, {String? 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
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