Flow Processing

Learn about functions used in flow processing.

We’ve presented Flow as a pipe through which values flow. As they do so, we can change them in different ways: drop, multiply, transform, or combine. These operations between flow creation and the terminal operation are called flow processing. In this chapter, we’ll learn about functions used for this.

Note: The functions presented here might remind us of the functions we use for Collection processing. This is no coincidence as they represent the same concepts, with the difference being that flow elements can be spread in time.

The map function

The first important function we need to learn about is map, which transforms each flowing element according to its transformation function. So, if we have a flow of numbers and our operation calculates the squares of these numbers, then the resulting flow will have the squares of these numbers.

Get hands-on with 1400+ tech skills courses.