package com.atlassian.stash.internal.concurrent;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * An {@link ExecutorService} that can be paused.
 *
 * New actions won't be started until the pause period is complete, but
 * existing executions will continue.
 * @since 1.3
 */
public interface PauseableExecutorService extends ExecutorService {

    /**
     * Pause all future executions until pauseTimeMillis has past.
     * @param pauseTime time to pause for
     * @param unit The time unit for pauseTime
     */
    void pauseFor(long pauseTime, TimeUnit unit);

}
