O'Reilly logo

Java 9 Programming By Example by Peter Verhas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reactive programming in Java

Java is not a reactive language. This does not mean that we cannot create reactive programs in Java. There are libraries that support different reactive programming approaches. It is to mention the Akka framework and the ReactiveX that also exist for other languages as well. With Java 9, the JDK starts to support reactive programming, providing a few classes and interfaces for the purpose. We will focus on these features.

The JDK contains the java.util.concurrent.Flow class, which contains related interfaces and some static methods to support flow controlled programs. The model that this class supports is based on Publisher, Subscriber, and Subscription.

As a very simple explanation, a Publisher accepts a subscription ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required