dispose method

Future<void> dispose()

Dispose the isolate

This exists the isolate

Implementation

Future<void> dispose() async {
  await _createdIsolate.future;
  _sendPort.send(null);
  _receivePort.close();
  await _events.cancel();
}