use of org.gradle.launcher.daemon.context.DaemonConnectDetails in project gradle by gradle.
the class DaemonStopClient method gracefulStop.
/**
* Requests that the given daemons stop when idle. Does not block and returns before the daemons have all stopped.
*/
public void gracefulStop(Collection<DaemonConnectDetails> daemons) {
for (DaemonConnectDetails daemon : daemons) {
DaemonClientConnection connection = connector.maybeConnect(daemon);
if (connection == null) {
continue;
}
try {
LOGGER.debug("Requesting daemon {} stop when idle", daemon);
stopDispatcher.dispatch(connection, new StopWhenIdle(idGenerator.generateId(), connection.getDaemon().getToken()));
LOGGER.lifecycle("Gradle daemon stopped.");
} finally {
connection.stop();
}
}
}
Aggregations