Future main(List<String> arguments, SendPort sendExitCommandPort)

Source

main(List<String> arguments, SendPort sendExitCommandPort) async {
  final exitCommandPort = new ReceivePort();

  final processHandler = new ProcessHandler(
      init: () {
        print('<gray><italic>Press Ctrl+C to exit</italic></gray>');
        return Application.boot(_findConfig());
      },
      deinit: (Application app) {
        return app.exit();
      }
  );

  if (sendExitCommandPort != null) {
    sendExitCommandPort.send(exitCommandPort.sendPort);

    exitCommandPort.listen((_) {
      processHandler.interrupt();
    });
  }

  await processHandler.run();

  exitCommandPort.close();
}