Forum Stats

  • 3,852,865 Users
  • 2,264,144 Discussions



Asynchronous Programming in Java 8: How to Use CompletableFuture

Laura Engin
Laura Engin Member Posts: 130 Green Ribbon
edited Apr 13, 2016 2:58PM in Social Groups

By Jose Paumard, Assistant Professor at the University Paris 13

Java 8 saw the introduction of a new API to handle asynchronous patterns. This API is built on two elements: the CompletionStage interface and the CompletableFuture class. This presentation aims to explain how the patterns introduced by this interface and it implementing class are new to the Java platform, and how they fill the gap in the old Future patterns.

The different models are precisely presented: how to create complex asynchronous processing pipelines, how to deal with exceptions, how to test such a complex code. Many examples are shown, from the classical question of remote service access to testing asynchronous REST Service. We will show the new patterns introduced to chain asynchronous operations and how to deal with special threads, especially in GUI environments. We will also describe new ideas in CDI: asynchronous events.

Additional Sources