Interface ClientExecutor


public interface ClientExecutor
Executor for client async processing and background task scheduling.
Since:
2.26
Author:
Adam Lindenthal
  • Method Details

    • submit

      <T> Future<T> submit(Callable<T> task)
      Submits a value-returning task for execution and returns a Future representing the pending results of the task. The Future's get() method will return the task's result upon successful completion.
      Type Parameters:
      T - task's return type
      Parameters:
      task - task to submit
      Returns:
      a Future representing pending completion of the task
    • submit

      Future<?> submit(Runnable task)
      Submits a Runnable task for execution and returns a Future representing that task. The Future's get() method will return the given result upon successful completion.
      Parameters:
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submit

      <T> Future<T> submit(Runnable task, T result)
      Submits a Runnable task for execution and returns a Future representing that task. The Future's get() method will return the given result upon successful completion.
      Type Parameters:
      T - result type
      Parameters:
      task - the task to submit
      result - the result to return
      Returns:
      a Future representing pending completion of the task
    • schedule

      <T> ScheduledFuture<T> schedule(Callable<T> callable, long delay, TimeUnit unit)
      Creates and executes a ScheduledFuture that becomes enabled after the given delay.
      Type Parameters:
      T - return type of the function
      Parameters:
      callable - the function to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      Returns:
      a ScheduledFuture that can be used to extract result or cancel
    • schedule

      ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
      Creates and executes a one-shot action that becomes enabled after the given delay.
      Parameters:
      command - the task to execute
      delay - the time from now to delay execution
      unit - the time unit of the daly parameter
      Returns:
      a scheduledFuture representing pending completion of the task and whose get() method will return null upon completion