async_queue
This dart package ensure your pack of async tasks execute in order, one after the other.
3.0.0
4.7K downloads/mo
#3928 most downloaded on pub.dev
samderlust/async_queue
What this package is like to depend on
Last release 4 months ago
05 Apr 2026
Release timing varies
gaps range from 3 weeks to 1.3 years
Nearly every release is documented
notes for 9 of 10 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
13 releases · first in 2022
2 releases in the last 12 months
see the full history below
Release timeline
13 releases · Oct 2022 to Apr 2026
2023
2024
2025
2026
Releases
latest 13-
3.0.005 Apr 2026Release notes
Open source →New Features
addJobnow returns aFuture— await the result of any individual job without relying on listeners. Works alongsidepreviousResultwithout conflict.- Automatic retry on job exceptions — jobs that throw are automatically retried up to
retryTimetimes. Manualretry()still works for custom logic. onErrorcallback — dedicated error handler onAsyncQueueandAsyncQueue.autoStartconstructors, called with(error, jobLabel)on each failure.- Priority queue —
addJobaccepts apriorityparameter (default 0). Higher priority jobs are placed closer to the front. Same-priority jobs maintain FIFO order. - Pause / Resume —
pause()halts processing after the current job finishes without losing queued jobs.resume()continues. AddsisPausedgetter andqueuePaused/queueResumedevents. - Retry with delay —
addJobaccepts aretryDelayDuration to wait between retry attempts. Works with both auto-retry and manualretry(). - Job timeout —
addJobaccepts atimeoutDuration. Jobs exceeding the timeout throwTimeoutException, triggering auto-retry like any other exception. isRunninggetter — exposes queue running state.- add
QueueEventType.jobError,QueueEventType.queuePaused,QueueEventType.queueResumedevents
Bug Fixes
- fix post-increment bug in duplicate label tracking (value was never actually incremented)
- fix null crash when
retry()is called on an empty queue - fix
_previousResultleaking across separatestart()runs - fix
addJobThrowlabel parameter type fromString?toObject?to matchaddJob - fix
_isForcedStopflag now properly cleared afterstart()loop exits instead of immediately instop() - fix failed nodes after auto-retry limit never being removed from queue (caused infinite loop)
Code Cleanup
- sync
AsyncQueueInterfacesignatures with actual implementation - remove dead commented-out code (
list(),getJobInfo()) from source and interface - remove unused imports and stray
print()calls from tests
Tests
- add test coverage for
addJobreturningFuture(result, chaining, autoStart, previousResult, closed queue) - add test coverage for
AsyncQueue.autoStart()(execution order, late adds, events, stop) - add tests for
onErrorcallback, priority ordering, pause/resume, retry delay, and job timeout - add meaningful job label assertions in event tests
- clean up
async_queue_info_test.dartwith actual assertions
-
2.1.002 Apr 2026Nothing published for this version
-
2.0.228 Nov 2024 -
2.0.128 Nov 2024 -
2.0.010 Oct 2023Release notes
Open source →- add Flutter example
- add
allowDuplicatedefault to true. - add
throwIfDuplicatedefault to false. - change
AsyncJob = Function(PreviousResult previousResult). This allows you to access the previous job's result when adding new job. - remove
list,getJobInfo, andaddNodefrom version2.0.0-dev.1as not needed. - hide
AsyncNode - remove
JobInfo - change job label type from
StringtoObject - add current running job label
CurrentJobUpdaterto notify every time a job is running
-
2.0.0-dev.315 Sep 2023 pre-releaseRelease notes
Open source →- change job label type from
StringtoObject - add current running job label
CurrentJobUpdaterto notify every time a job is running
- change job label type from
-
2.0.0-dev.213 Sep 2023 pre-releaseRelease notes
Open source →- add Flutter example
- add
allowDuplicatedefault to true. - add
throwIfDuplicatedefault to false. - change
AsyncJob = Function(PreviousResult previousResult). This allows you to access the previous job's result when adding new job. - remove
list,getJobInfo, andaddNodefrom version2.0.0-dev.1as not needed. - hide
AsyncNode - remove
JobInfo
-
2.0.0-dev.116 Nov 2022 pre-releaseRelease notes
Open source →- option to add the job that failed back in to the queue. (last position)
- expose [AsyncNode]
- [addNode] on [AsyncQueue]
-
1.3.011 Nov 2022Release notes
Open source →- option to add
labelanddescriptionwhen adding job - [label] need to be unique unless [DuplicatedLabelException] will throw.
- in [AsyncQueue.addJob] if provide
retryTime = -1will make the job retry infinitely until it success. You still have to explicitly callretry. Be careful when using this option. - emit event when job hits its max retry limit [QueueEventType.retryLimitReached]
- add [AsyncQueue.list] and [AsyncQueue.getJobInfo] to retrieve the jobs info event when queue finished
- add [AsyncQueue.clear] to clear the info list and also stop the queue if it's running
- option to add
-
1.2.030 Oct 2022Release notes
Open source →- add
stop()to stop and remove all remaining jobs in the queue - add
retry()to retry the job, default to 1 time, but user can set as many time as they want - remove
{bool forceStop = false}inclose()since we now havestopmethod - fix typo
- add test cases
- add
-
1.1.123 Oct 2022 -
1.1.022 Oct 2022Release notes
Open source →- [breaking change] remove
beforeListenerandafterListener. One listener will emiteventwith type. - add
close({bool forceStop = false})close the queue so that no more job can be added. [forceStop] if true, all remain jobs will be canceled addJobThrowAdd new job in to the queue if the queue is closed, throw [ClosedQueueException]- add test cases
- [breaking change] remove
-
1.0.022 Oct 2022Release notes
Open source →- (Normal Queue) Add multiple jobs into queue before firing
- (Auto Queue) Firing job as soon as any job is added to the queue
- (Both) Option to add queue listener that happens before or after execute every job