private void asyncRun()

in appengine-plugins-core/src/main/java/com/google/cloud/tools/appengine/operations/cloudsdk/process/LegacyProcessHandler.java [150:176]


  private void asyncRun(
      final Process process,
      @Nullable final Thread stdOutHandler,
      @Nullable final Thread stdErrHandler)
      throws ProcessHandlerException {
    if (!exitListeners.isEmpty()
        || !stdOutLineListeners.isEmpty()
        || !stdErrLineListeners.isEmpty()) {
      Thread exitThread =
          new Thread("wait-for-process-exit-and-output-handlers") {
            @Override
            public void run() {
              try {
                syncRun(process, stdOutHandler, stdErrHandler);
              } catch (InterruptedException | AppEngineException ex) {
                logger.log(
                    Level.INFO, "wait-for-process-exit-and-output-handlers exited early", ex);
              }
            }
          };
      exitThread.setDaemon(true);
      exitThread.start();
      if (waitingProcessOutputLineListener != null) {
        waitingProcessOutputLineListener.await();
      }
    }
  }