October 2018
Intermediate to advanced
556 pages
15h 18m
English
Of course, Project Reactor could not omit the implementation of the flatMap operator as it is a crucial transformation in functional programming itself.
The flatMap operator logically consists of two operations—map and flatten (in terms of Reactor, flatten is similar to the merge operator). The map part of the flatMap operator transforms each incoming element into a Reactive Stream (T -> Flux<R>), and the flatten part merges all generated reactive sequences into a new reactive sequence, through which it passes elements of type R.
The following marble diagram may help us grasp the idea:
In the preceding diagram, for each circle(n), we generate square(n) ...