Using Other Reactive Operators
In this module, we’re going to review operators for:
- Transforming sequences (in addition to map and flatMap)
- Combining publishers
- Combining tasks or actions
- Filtering sequences
- Branching on empty sequences
- Aggregating a Flux
- Listening to lifecycle hooks
For each operator, I’m going to present its description, its syntax, a few examples, and optionally, how it’s related to other operators. Also, for the first sections, I’ll show you the marble diagrams of some operators so you can better understand them.
You can find the code for this module here.
After this module, you’ll know many of the most used operators. However, there will be a lot more to learn. The best resource is Appendix A: Which operator do I need?, from the reference documentation. I recommend you to, at least, browse through all the subsections so you can better know all the operators provided by Reactor.
Links
- What’s the difference between flatMap, flatMapSequential and concatMap in Project Reactor?
- Reactive Programming: The Hitchhiker’s Guide to map operators
- Tuple2<T1,T2>
- Appendix A: Which operator do I need?
- Javadoc for Mono
- Javadoc for Flux
Table of contents
- More Operators For Transforming Sequences
- Combining Publishers
- Combining Actions
- Filtering Sequences
- Branching on Empty Sequences
- Aggregating a Flux
- Life Cycle Hooks
- Coding Exercises