Skip to content
d-markey edited this page Jun 22, 2023 · 18 revisions

Squadron

Multithreading and worker pools in Dart.

Offload CPU-bound and long running tasks and give your mobile and Web apps some air!

Pub Package Dart Platforms Flutter Platforms

License Null Safety Dart Style Pub Points Likes Popularity

Last Commit Dart Workflow Code Lines Code Coverage

Squadron is a multithreading library, providing cross-platform workers and worker pools to offload CPU-bound or long running tasks in Dart and Flutter.

Squadron takes care of all plumbing aspects to have your code run in platform threads (Isolates or Web Workers) while keeping it callable from your main app code seamlessly. Developers simply focus on implementing the services that will run in separate threads, and on wrapping those services in Squadron Workers.

Even better, Squadron comes with annotations leveraged by companion package squadron_builder to automatically generate the boilerplate code necessary to initialize and wrap custom services into workers and worker pools!

Typical use-cases:

  • fight UI jank: execute code that creates UI jank in a single Worker -- it will not run faster, but will help keep the app responsive to user actions.

  • parallelize computations: execute parallelizable algorithms by distributing workloads to a set of Workers or to a WorkerPool and get results quicker.

Clone this wiki locally