Skip to content
pubscout

queue

3.4.0, released 2 years ago by an unverified publisher

Queue up futures from multiple sources and await their return anywhere in your code.

WASM-ready
$ flutter pub add queue
Source repository

What it does

A central queue for executing futures in order and returning their results. It supports parallel execution limits, delays between tasks, LIFO processing, and cancellation.

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

Use it when

  • You need to rate limit calls to external devices or APIs
  • You want to process multiple asynchronous tasks sequentially or with a parallel limit

Skip it when

  • You are managing complex reactive UI state where a stream controller or state management library is better suited

Strengths

  • Supports parallel processing limits and rate-limiting delays
  • Allows adding items to the front of the queue
  • Provides completion and remaining item stream tracking

Weaknesses

  • Cancelled queues throw exceptions and must be recreated rather than restarted

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

not documented

import 'package:queue/queue.dart';

main() async {
  final queue = Queue();
  final result = await queue.add(()=>Future.delayed(Duration(milliseconds: 10)));
}

Alternatives

Packages that do the same job and could replace queue.

  • dart_style

    Provides an API and CLI to format Dart source code automatically.

  • source_span

    Standard representation for source code locations, spans, and human-friendly error messages.

  • http_status_code

    A Dart library providing constants and helpers for HTTP status codes.

  • p_limit

    Run multiple future-returning and async functions with limited concurrency.

Works with

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