-
-
Notifications
You must be signed in to change notification settings - Fork 7
Home
d-markey edited this page Jan 29, 2026
·
23 revisions
|
|
Squadron is a powerful Dart library designed to simplify multithreading and worker thread pools. It allows you to offload CPU-bound and long-running tasks to background threads, keeping your application responsive and smooth. ✨
- 🌍 Cross-Platform: Works on native platforms (Windows, Linux, macOS, Android, iOS) using Isolates and on Web platforms (JavaScript, Web Assembly) using Web Workers.
- 🎯 Type Safety: Strong typing support with automatic code generation to handle the complexities of crossing thread boundaries.
- 🏗️ Worker Pools: Easily manage pools of workers to handle concurrent tasks efficiently.
- ⚡ Easy Integration: Powered by squadron_builder and build_runner to generate boilerplate code for you.
- Getting Started - Set up your first Squadron project.
-
Installation and Generation - Configuring
build_runnerand generating worker code.
-
Defining Services - How to write
@SquadronServiceclasses and@SquadronMethods. -
Annotations - Reference for
@SquadronService,@SquadronMethod, and others. -
Workers and Pools - Managing
Workerinstances andWorkerPoolscalability. - Platform Support - Details on compiling for Web (JS/Wasm) vs Native.
- Data Transfer and Types - Understanding how data moves between threads.
- Marshaling - Handling custom objects and complex data structures.
-
Converters - Handling platform-specific type differences (e.g.
intvsdoubleon Web).
-
Worker Orchestration - Making workers collaborate with
@sharedService. - Service Setup - Initializing services and configuring threads.
- Task Cancellation - Cancelling running tasks gracefully.
- Streams and Events - Streaming data from background workers.
- Observability and Logging - Debugging and logging from background threads.
- Exception Management - Handling and customizing exceptions across threads.
- Manual Implementation - Understanding the inner workings without generation.
- Channels Deep Dive - How Squadron abstracts Isolates and Web Workers.
- Internal Logging Mechanism - How Squadron captures and forwards log output from worker threads.
- Internal Cancelation Mechanism - How signals are propagated appropriately to workers.
- Internal Exception Handling - How exceptions are caught, serialized and propagated back.
- Troubleshooting - Common issues and solutions.
- Report an Issue - Found a bug? Let us know on GitHub!
- Squadron on pub.dev - Version history and package scores.
- API Documentation - Detailed API reference on pub.dev.
💖 Support the project! Sponsor d-markey on GitHub.