// Kill workers on Ctrl-C to quickly end the interrupted build. // TODO(philwo) - make sure that this actually *kills* the workers and not just politely waits // for them to finish. @Subscribe public void buildInterrupted(BuildInterruptedEvent event) { if (workers != null) { if (verbose) { env.getReporter().handle(Event.info("Build interrupted, shutting down worker pool...")); } workers.close(); workers = null; } }
@Subscribe public void buildComplete(BuildCompleteEvent event) { if (workers != null && buildRequest.getOptions(WorkerOptions.class).workerQuitAfterBuild) { if (verbose) { env.getReporter().handle(Event.info("Build completed, shutting down worker pool...")); } workers.close(); workers = null; } }