A lightweight, flexible worker pool framework for Dart applications.
Loom provides a robust foundation for managing concurrent task execution with:
- Priority-based scheduling - Critical tasks run first
- Automatic retry - Configurable retry policies with backoff
- Graceful cancellation - Cancel queued or running jobs
- Progress reporting - Real-time progress streams
- Multiple execution modes - Main isolate, background isolates, or test mode
- Lifecycle hooks - Monitor pool activity
| Package | Description |
|---|---|
| loom | Core worker pool framework |
- Dart SDK ^3.10.7
- Melos for monorepo management
# Install melos globally
dart pub global activate melos
# Bootstrap the workspace
melos bootstrap# Run all tests
melos run test
# Run analyzer
melos run analyze
# Format code
melos run format
# Run all checks (analyze + format + test)
melos run check
# Run performance tests
melos run test:perf
# Run example
melos run run:exampleimport 'package:loom/loom.dart';
void main() async {
// Define a task
final task = Task<String, int>.simple(
name: 'parseNumber',
executor: (input, ctx) async => int.parse(input),
);
// Create a pool
final pool = WorkerPool.io('my-pool');
// Submit work
final handle = pool.submit(task, '42');
final result = await handle.result;
print('Parsed: ${result.valueOrThrow}'); // 42
await pool.shutdown();
}- Fork the repository
- Create a feature branch
- Make your changes
- Run
melos run checkto verify - Submit a pull request
See LICENSE for details.