IsolatePool class
A pool of isolates for executing heavy computation tasks.
Provides a general-purpose isolate pool that can handle any heavy computation with automatic work distribution, lifecycle management, and error handling.
Constructors
- IsolatePool({int poolSize = 2})
- Create an isolate pool with the specified number of workers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- poolSize → int
-
Number of worker isolates managed by this pool.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → IsolatePoolStatus
-
Get the current status of the isolate pool
no setter
Methods
-
dispose(
) → Future< void> - Dispose the isolate pool and all workers
-
execute<
T, R> (FutureOr< R> callback(T message), T message) → Future<R> - Execute a callback function in an isolate
-
executeIfNeeded<
T, R> (R callback(T message), T message, {int threshold = 100 * 1024}) → Future< R> - Execute a callback function in an isolate with automatic threshold detection
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited