ensureReceiving method

Future<void> ensureReceiving()

Restarts the receive isolate if it stopped (e.g. after the OS froze a backgrounded Android app). Safe to call any time; call it on resume.

Implementation

Future<void> ensureReceiving() async {
  if (_closed || _receiving) return;
  await _spawnWorker();
}