isolate_manager
6.3.2, released 7 months ago by lamnhan.dev
Manage long-lived isolates across native, Web, and WASM platforms with built-in queuing and workers.
What it does
Simplify concurrent programming in Flutter and Dart by providing long-lived single or multi-function isolates, automatic task queuing, and web worker generation. It allows running heavy calculations seamlessly on native threads, JavaScript Workers, and WebAssembly.
AI-written summary of version 6.3.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to run heavy background computations without freezing the UI thread.
- Your Flutter app targets web and WASM alongside mobile and desktop.
- You want advanced queue management like priority tasks or custom overflow strategies.
Skip it when
- Your app requires simple, one-off asynchronous functions where `compute` from `flutter/foundation.dart` is sufficient.
- You cannot annotate your isolate functions as static or top-level entries.
Strengths
- True cross-platform support including Web Workers and WebAssembly (WASM).
- Intelligent queue system with custom strategies and priority handling.
- Versatile isolate types (one-off, single-function, and multi-function).
Weaknesses
- Web targets require a separate generator command to compile JS workers.
- Functions targeting web workers have strict data transfer limitations.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 3
No setup required for Mobile & Desktop. Web targets require running the isolate generator and ensuring proper headers if using WASM.
import 'package:isolate_manager/isolate_manager.dart';
@pragma('vm:entry-point')
int sum(List<int> numbers) {
return numbers.reduce((a, b) => a + b);
}
void main() async {
final result = await IsolateManager.runFunction(sum, [1, 2, 3]);
print('Result: $result');
}Alternatives
Packages that do the same job and could replace isolate_manager.
- flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare - isolate_channel
Communication channels for isolates based on Flutter's platform channels.
82Compare - computer
Easy to use pool of concurrent workers with a compute-like API.
48Compare - integral_isolates
Easy to use isolates for Dart and Flutter using a long-lived isolate.
50Compare
Works with
Packages commonly used together with isolate_manager: ones it builds on, ones built on it, and its own family.
- webisolate_manager depends on itLightweight bindings for browser APIs via JS interop
- stream_channelisolate_manager depends on itAn abstraction for two-way communication channels based on the Dart Stream class.
- re_editorBuilt on isolate_managerA lightweight text and code editor widget for Flutter with syntax highlighting and folding.