isolate_channel library

Classes

IsolateConnection
A connection between isolates
IsolateEventChannel
A channel for receiving events from an isolate
IsolateEventSink
A sink for sending events to the stream
IsolateException
An exception returned by an isolate
IsolateMethodCall
A method call from one isolate to another
IsolateMethodChannel
A method channel for inter-isolate method invocation
IsolateStreamHandler
A handler for setting up stream handling

Functions

connectToIsolate(SendPort send) IsolateConnection
Helper function to connect to an existing isolate
setupIsolate(SendPort send) IsolateConnection
Helper function to set up an isolate for channel communication
spawnIsolate<T>(IsolateEntryPoint entryPoint, {bool paused = false, bool errorsAreFatal = true, void onConnect(SendPort send)?, void onExit()?, void onError(String error, StackTrace stackTrace)?, String? debugName}) Future<IsolateConnection>
Helper function to spawn an isolate that supports channel communication
spawnUriIsolate<T>(Uri uri, {bool paused = false, bool errorsAreFatal = true, void onConnect(SendPort send)?, void onExit()?, void onError(String error, StackTrace stackTrace)?, String? debugName}) Future<IsolateConnection>
Helper function to spawn an isolate by URI

Typedefs

IsolateEntryPoint = void Function(SendPort send)
The entry point of an isolate spawned with Isolate.spawn
IsolateStreamHandlerOnCancel = void Function(dynamic arguments)
Typedef for the inline onCancel callback
IsolateStreamHandlerOnListen = void Function(dynamic arguments, IsolateEventSink events)
Typedef for the inline onListen callback
MethodCallHandler = FutureOr Function(IsolateMethodCall call)
A handler for method invocations
UriIsolateEntryPoint = void Function(List<String> args, SendPort send)
The entry point of an isolate spawned with Isolate.spawnUri