stop method

Future<void> stop()

Stop the server gracefully, in every isolate:

  1. stop taking new connections
  2. wait for open requests, up to config.shutdownTimeout
  3. run the DoxShutdown services (eg. close database connections)
  4. close the cache stores (eg. Redis connections)

SIGTERM and SIGINT call this, then exit the process.

await Dox().stop();

Implementation

Future<void> stop() async {
  _cancelSignals();
  await Future.wait(<Future<void>>[
    DoxIsolate().stopAll(config.shutdownTimeout),
    stopIsolate(),
  ]);
}