spawn static method
Future<IsolateSupervisor>
spawn(
- MultiIsolateServer multiIsolateServer,
- FutureOr<
void> spawn(), - int identifier
Implementation
static Future<IsolateSupervisor> spawn(
MultiIsolateServer multiIsolateServer,
FutureOr<void> Function(SendPort?) spawn,
int identifier,
) async {
var receivePort = ReceivePort();
var sendPort = receivePort.sendPort;
var isolate = await Isolate.spawn<SendPort>(spawn, sendPort, //
paused: true,
onExit: sendPort,
onError: sendPort,
debugName: 'server/$identifier');
return IsolateSupervisor(multiIsolateServer, isolate, receivePort);
}