Advertisement

Use in Multithreaded Programs

  • Ralph Lecessi
Chapter

Abstract

Runnable and Callable are interfaces whose implementations contain computations meant to be performed in a thread separate from the calling thread. The CompletionStage interface models computations that can be performed as part of a future chain. CompletableFuture is a class that implements CompletionStage, and also implements the Future interface. CompletionStage’s thenApply method accepts a function that operates on the result of the current stage. The method executes after the current stage completes, and returns a new CompletionStage that can be used in a future chain.

Copyright information

© Ralph Lecessi 2019

Authors and Affiliations

  • Ralph Lecessi
    • 1
  1. 1.Kendall ParkUSA

Personalised recommendations