Interface ExecutionService.CloseableExecutor

  • All Superinterfaces:
    Executor
    Enclosing interface:
    ExecutionService

    public static interface ExecutionService.CloseableExecutor
    extends Executor
    Like an ExecutorService, but simpler. It is not up to the client to decide whether to terminate the backing Executor or not. They simply get to say that they are done with it
    • Method Detail

      • stop

        boolean stop​(long timeout,
                     @NonNull
                     TimeUnit unit)
        The executor will accept no more tasks. It will complete executing all currently enqueued tasks, if possible. This method will return when all tasks have run or when the timeout elapses, whichever comes first.
        Parameters:
        timeout - time to wait for shutdown
        unit - time unit for shutdown wait
        Returns:
        true if all scheduled tasks have been completed