Executors

The Java Concurrency API defines the following 3 base interfaces for executors:

  • Executor : is the super type of all executors. It defines only one method execute(Runnable)

  • ExecutorService: is an Executor that allows tracking progress of value-returning tasks (Callable) via Future object, and manages the termination of threads. Its key methods include submit() and shutdown().

  • ScheduledExecutorService: is an ExecutorService that can schedule tasks to execute after a given delay, or to execute periodically. Its key methods are schedule(), scheduleAtFixedRate() and scheduleWithFixedDelay().

Last updated

Was this helpful?