isolate_workgroup 1.0.0
isolate_workgroup: ^1.0.0 copied to clipboard
A Dart package for managing a dynamic group of isolates — supports one-off job dispatch, persistent members, health monitoring, and runtime workgroup resizing.
1.0.0 #
Initial public release. A dynamic pool of worker isolates for parallel
processing in Dart, forked and rebranded from isolate_pool_2.
Highlights #
IsolateWorkgroup— top-level pool withlaunch(),dispatch(),addInstance(),kill(),addIsolate(),shutdown(),probe(), and typed error handlers viasetErrorHandler(IsolateErrorType.…).WorkgroupJob<E>— one-off jobs withFuture<E> execute().WorkgroupMember+MemberProxy<T>— persistent stateful workers addressed by proxy, withsetup()/handle()/dispose()lifecycle andWorkerCommand-based RPC.CallbackWorkgroup<R, A>— single-shot job withreport(arg)progress callbacks.WorkgroupHealthConfig—disabled/aggressive/relaxedpresets, plus per-field tuning of ping timeouts, staleness, failure thresholds, and pre-dispatch checks.WorkgroupConfig— bundlesonSetup,fatalErrors,labelBuilder,startupPolicy(concurrent/sequential), and health config.- 9 typed exceptions —
WorkgroupException,WorkgroupInactiveException,WorkgroupJobAbortedException,WorkgroupNotReadyException,WorkgroupSetupException,WorkgroupTimeoutException,WorkgroupMemberNotFoundException,WorkgroupMemberDeadException,InvalidWorkgroupResponseException. - Validation helpers —
canBeSentToIsolate(obj)and theWorkgroupMemberValidationextension.
Documentation #
- README with hero animation, API cheatsheet, and architecture diagram.
BEST_PRACTICES.md— sizing, payload design, closure-capture pitfalls, error handling, health-check tuning, and large-binary transfers.example/example.dart— parallel reduce and stateful counter samples.
Tests #
- 199 tests across fast / slow / perf suites covering lifecycle, dispatch, members, kill, addIsolate, validation, error handlers, health, callback workgroup, init policy, concurrency stress, memory leaks, subprocess exit, and informational benchmarks.