async_queue
3.0.0, released 8 months ago by samderlust.com
Ensure async tasks execute sequentially in order, one after the other.
WASM-ready
What it does
Ensures that a pack of asynchronous tasks executes in order, one after the other. It supports features like auto-start, priority ordering, job timeouts, retry with delay, and pause/resume functionality.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need multiple asynchronous tasks or network requests to execute strictly in sequence.
- You want to prevent multiple requests from hitting your backend simultaneously in a short time frame.
Skip it when
- You need parallel execution of independent asynchronous tasks.
- You are looking for complex state management solutions.
Strengths
- Easy to use with support for both manual and auto-start queues.
- Provides advanced features such as priorities, job timeouts, and automatic retries.
- Allows awaiting individual job results via Futures.
Weaknesses
- Limited to sequential execution, which may slow down independent tasks if queued together.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
final asyncQ = AsyncQueue.autoStart();
asyncQ.addJob((_) => Future.delayed(const Duration(seconds: 1), () => print('Task 1')));
asyncQ.addJob((_) => Future.delayed(const Duration(seconds: 2), () => print('Task 2')));Alternatives
Packages that do the same job and could replace async_queue.