IsolateChannel<T>.connectSend constructor

IsolateChannel<T>.connectSend(SendPort sendPort)

Connects to a remote channel that was created with IsolateChannel.connectReceive.

These constructors establish a connection using only a single SendPort/ReceivePort pair, as long as each side uses one of the connect constructors.

The connection protocol is guaranteed to remain compatible across versions at least until the next major version release.

Implementation

factory IsolateChannel.connectSend(SendPort sendPort) {
  var receivePort = new ReceivePort();
  sendPort.send(receivePort.sendPort);
  return new IsolateChannel(receivePort, sendPort);
}