isolate library

Utilities for working with isolates and isolate communication.

Classes

IsolateRunner
An easier to use interface on top of an Isolate.
IsolateRunnerRemote
The remote part of an IsolateRunner.
LoadBalancer
A pool of runners, ordered by load.
Registry<T>
An isolate-compatible object registry.
RegistryManager
The central repository used by distributed Registry instances.
Runner
Calls a function with an argument.
SingleResponseChannel<R>
A Future and a SendPort that can be used to complete the future.

Functions

completeFutureResult<R>(List<Object?> response, Completer<R> completer) → void
Completes a completer with a message created by sendFutureResult
receiveFutureResult<R>(List<Object?> response) Future<R>
Converts a received message created by sendFutureResult to a future result.
sendFutureResult(Future<Object?> future, SendPort resultPort) → void
Send the result of a future, either value or error, as a message.
singleCallbackPort<P>(void callback(P response), {Duration? timeout, P? timeoutValue}) SendPort
Create a SendPort that accepts only one message.
singleCallbackPortWithTimeout<P>(void callback(P response), Duration timeout, P timeoutValue) SendPort
Create a SendPort that accepts only one message.
singleCompletePort<R, P>(Completer<R> completer, {FutureOr<R> callback(P message)?, Duration? timeout, FutureOr<R> onTimeout()?}) SendPort
Create a SendPort that accepts only one message.
singleResponseFuture<R>(void action(SendPort responsePort), {Duration? timeout, R? timeoutValue}) Future<R>
Creates a Future, and a SendPort that can be used to complete that future.
singleResponseFutureWithTimeout<R>(void action(SendPort responsePort), Duration timeout, R timeoutValue) Future<R>
Same as singleResponseFuture, but with required timeoutValue, this allows us not to require a nullable return value
singleResultFuture<R>(void action(SendPort responsePort), {Duration? timeout, FutureOr<R> onTimeout()?}) Future<R>
Creates a Future, and a SendPort that can be used to complete that future.