Skip to content
pubscout

queue_it

1.0.0, released 8 days ago by sharpsan.dev

A Dart queue with concurrency, retries and event listeners

WASM-ready
$ flutter pub add queue_it
Source repository

What it does

QueueIt provides an in‑memory queue that can process items concurrently, automatically retry failures, and emit snapshots of its state. It exposes a stream of updates and helper methods for adding, canceling, and querying items.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Managing background tasks like file uploads or downloads
  • Implementing retry logic for transient failures
  • Building a simple task scheduler in a Flutter or Dart app

Skip it when

  • Persisting queue state across app restarts
  • Needing a database or key‑value store for queued items
  • Complex state management that requires a dedicated state‑management solution

Strengths

  • Built‑in concurrency control
  • Automatic retry with customizable delay and condition
  • Stream of queue snapshots for reactive UI updates

Weaknesses

  • In‑memory only, no persistence
  • No built‑in integration with Flutter widgets (requires flutter_queue_it companion)
  • Limited to single‑process usage

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
final queue = QueueIt<int>(
  parallel: 2,
  retries: 3,
  itemHandler: (item) async {
    print('Processing ${item.data}');
    await Future<void>.delayed(const Duration(seconds: 1));
  },
);
queue.onUpdate.listen((snapshot) {
  print('Event: ${snapshot.event.name}');
});
queue.add(1);
queue.add(2);
queue.start();

Alternatives

Packages that do the same job and could replace queue_it.

  • synchronized

    Lock mechanism to prevent concurrent access to asynchronous code.

  • secretary

    A Dart library for managing queues of asynchronous tasks with validation, retries and event streams.

  • fluri

    A fluent API for building and mutating URIs in Dart

  • concurrent_queue

    Priority queue with concurrency control for async and sync operations.

Works with

Packages commonly used together with queue_it: ones it builds on, ones built on it, and its own family.