stop method

Future<void> stop()

Implementation

Future<void> stop() async {
  final process = _process;
  _process = null;
  _lines = null;
  if (process == null) return;
  try {
    process.stdin.writeln('{"cmd":"quit"}');
    await process.stdin.flush();
    await process.exitCode.timeout(const Duration(seconds: 3));
  } on Object {
    process.kill();
  }
}