dart-concurrency-isolates
Installation
SKILL.md
Managing Dart Concurrency and Isolates
Contents
- Core Guidelines
- Choosing the Right Isolate Strategy
- Implementing One-Off Tasks
- Implementing Long-Running Workers
- Workflows
- Examples
Core Guidelines
- Isolate Memory: Assume zero shared memory between isolates. Isolates communicate exclusively via message passing.
- Data Transfer: Avoid passing large mutable objects between isolates. Prefer simple data types or immutable records to minimize serialization overhead.
- Resource Management: Always ensure isolates and ports are terminated when no longer needed to prevent memory leaks.
- Platform Limitations: Do not use isolates on the Dart Web platform. Web compiles to JavaScript, which uses Web Workers instead.
- Related Skills: Refer to
dart-async-programmingfor standard asynchronous operations (Future,Stream,async/await) running on the Main Isolate.