stopIsolate method

Future<void> stopIsolate()

stop for this isolate only. Internal: each isolate runs it.

Implementation

Future<void> stopIsolate() async {
  await DoxServer().shutdown(config.shutdownTimeout);
  for (DoxService service in doxServices) {
    if (service is! DoxShutdown) continue;
    try {
      await (service as DoxShutdown).shutdown();
    } catch (error, stackTrace) {
      config.exceptionHandler.report(error, stackTrace);
    }
  }
  // after the services: they may still use the cache
  try {
    await cache.close();
  } catch (error, stackTrace) {
    config.exceptionHandler.report(error, stackTrace);
  }
}