IsolateNameServer class Null safety

Static methods to allow for simple sharing of SendPorts across Isolates.

All isolates share a global mapping of names to ports. An isolate can register a SendPort with a given name using registerPortWithName; another isolate can then look up that port using lookupPortByName.

To create a SendPort, first create a ReceivePort, then use ReceivePort.sendPort.

Since multiple isolates can each obtain the same SendPort associated with a particular ReceivePort, the protocol built on top of this mechanism should typically consist of a single message. If more elaborate two-way communication or multiple-message communication is necessary, it is recommended to establish a separate communication channel in that first message (e.g. by passing a dedicated SendPort).

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

lookupPortByName(String name) SendPort?
Looks up the SendPort associated with a given name.
registerPortWithName(SendPort port, String name) bool
Registers a SendPort with a given name.
removePortNameMapping(String name) bool
Removes a name-to-SendPort mapping given its name.