Enhancements

The CompletableFuture<T> class received the following enhancements as part of the current Java platform:

  • Added time-based enhancements:
  • This enables completion based on lapsed time
  • Delayed executions are now also supported
  • Significant enhancement to subclasses:
    • Extending CompletableFuture is easier
    • Subclasses support alternative default executors

Specifically, the following methods were added in Java 9:

  • newIncompleteFuture()
  • defaultExecutor()
  • copy()
  • minimalCompletionStage()
  • completeAsync()
  • orTimeout()
  • completeOnTimeout()
  • delayedExecutor()
  • completedStage()
  • failedFuture()
  • failedStage()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset