start method

Future<void> start(
  1. void entryPoint(
    1. dynamic mainSendPortArg
    )
)

Spawns the worker isolate with entryPoint.

Implementation

Future<void> start(void Function(dynamic) entryPoint) async {
  if (_disposed) return;
  final isolate = await Isolate.spawn(entryPoint, _receivePort.sendPort);
  if (_disposed) {
    isolate.kill(priority: Isolate.immediate);
  } else {
    _isolate = isolate;
  }
}