Skip to content
pubscout

secretary

1.3.0, released 10 days ago by alxbkr.xyz

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

WASM-ready
$ flutter pub add secretary
Source repository

What it does

It provides a typed queue for async functions, allowing you to limit concurrency, validate results, and retry on failure. It also emits streams for results, errors and task lifecycle events, and can link multiple queues together.

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

Use it when

  • You need to process many async operations without overwhelming resources
  • You require built‑in retry policies and result validation
  • You want to observe task progress via streams

Skip it when

  • You need scheduled or cron‑like task execution (not yet supported)
  • You need a full state‑management solution for UI
  • You prefer a UI‑focused widget library

Strengths

  • Strong typing for keys and results
  • Configurable retry limits, policies and conditions
  • Event streams for results, errors and task states
  • Ability to link multiple queues

Weaknesses

  • No built‑in scheduling of tasks
  • Relies on the elegant package for Result type
  • Limited to Dart logic, no platform‑specific integrations

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
final secretary = Secretary<String,int>(validator:(code)=>code==200?null:code,maxAttempts:5);
for (var p in paths){
  secretary.add(p,()=>uploadFile(p));
}

Alternatives

Packages that do the same job and could replace secretary.

  • async

    Provides basic async utilities like StreamQueue, but lacks the rich task‑queue features of Secretary