Dart API Referencedart:isolate

dart:isolate library

Properties

final ReceivePort port #

The initial ReceivePort available by default for this isolate. This ReceivePort is created automatically and it is commonly used to establish the first communication between isolates (see spawnFunction and spawnUri).

external ReceivePort get port;

Functions

SendPort spawnUri(String uri) #

Creates and spawns an isolate whose code is available at uri. Like with spawnFunction, the child isolate will have a default ReceivePort, and a this function returns a SendPort derived from it.

See comments at the top of this library for more details.

external SendPort spawnUri(String uri);

SendPort spawnFunction(void topLevelFunction()) #

Creates and spawns an isolate that shares the same code as the current isolate, but that starts from topLevelFunction. The topLevelFunction argument must be a static top-level function or a static method that takes no arguments. It is illegal to pass a function closure.

When any isolate starts (even the main script of the application), a default ReceivePort is created for it. This port is available from the top-level getter port defined in this library.

spawnFunction returns a SendPort derived from the child isolate's default port.

See comments at the top of this library for more details.

external SendPort spawnFunction(void topLevelFunction());

Classes

Interfaces

Exceptions