Search in sources :

Example 1 with DaemonConnectDetails

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();
        }
    }
}
Also used : DaemonConnectDetails(org.gradle.launcher.daemon.context.DaemonConnectDetails) StopWhenIdle(org.gradle.launcher.daemon.protocol.StopWhenIdle)

Aggregations

DaemonConnectDetails (org.gradle.launcher.daemon.context.DaemonConnectDetails)1 StopWhenIdle (org.gradle.launcher.daemon.protocol.StopWhenIdle)1