Book Image

Learning Reactive Programming with Java 8

By : Nickolay Tzvetinov
Book Image

Learning Reactive Programming with Java 8

By: Nickolay Tzvetinov

Overview of this book

Table of Contents (15 chapters)
Learning Reactive Programming with Java 8
About the Author
About the Reviewers

Observable transformations

We've used the map() operator in some of the previous examples. The higher order functions which transform the incoming values into something else are called transformations. The higher order functions that can be invoked on an Observable instance, producing a new Observable instance from it, are called operators. The transforming operators transform the elements emitted from the source Observable instance in some way.

In order to understand how the different operators work, we will be using pictures called marble diagrams. For example, this one describes the map operator:

The rectangle in the center of the diagram represents the operator (function). It transforms its input (circles) into something else (triangles). The arrow above the rectangle represents the source Observable instance, the colored circles on it represent OnNext notifications emitted in time, and the vertical line at the end is the OnCompleted notification. The arrow below the rectangle is the...