executor_lib library

Provides an abstraction for executing jobs.

Classes

DirectExecutor
Directly runs jobs by scheduling them as a microtask
Executor
An executor runs Jobs
IsolateExecutor
Runs jobs on a single isolate.
Job<Q, R>
a job for execution on an Executor
PoolExecutor
Runs jobs on a pool of isolates. Uses isolate affinity for jobs having the same deduplication key, otherwise uses round robin to select an isolate.
QueueExecutor
Runs jobs on the UI thread.

Extensions

CancellationFuture on Future<T>
Thrown when a job is cancellled

Functions

newExecutor({required int concurrency}) Executor
Creates a new executor with the given concurrency. Uses isolates unless in debug mode

Typedefs

CancellationCallback = bool Function()

Exceptions / Errors

CancellationException
thrown when a job is cancelled