kill method

Future<void> kill()

Termina l'isolate

Implementation

Future<void> kill() async {
  if (isEnded)
    return;

  _state = IsolateState.killed;
  // Completiamo il Future emesso dalla listen
  _completer.complete(KilledError().toInvalid());

  _close();
  final i = await _isolate!;
  i.kill(priority: Isolate.immediate);
}