Skip to content

zooper-lib/loom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loom

A lightweight, flexible worker pool framework for Dart applications.

Overview

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

Packages

Package Description
loom Core worker pool framework

Getting Started

Prerequisites

  • Dart SDK ^3.10.7
  • Melos for monorepo management

Setup

# Install melos globally
dart pub global activate melos

# Bootstrap the workspace
melos bootstrap

Common Commands

# 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:example

Quick Example

import '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();
}

Documentation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run melos run check to verify
  5. Submit a pull request

License

See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages