Skip to content

Tag: project-reactor

Why many people say that flatmap in reactor is one-to-many?

I’ve read that wonderful answer about the difference between map and flatMap. And there is a picture that demonstrates flatmap: And quote: The map is for synchronous, non-blocking, one-to-one transformations while the flatMap is for asynchronous (non-blocking) One-to-Many transformations. Based on that picture and quote I understand that flatMap allows the creation of more (or fewer) elements than it was

How to consume infinite flux multiple times

This is what I’m trying to achieve: When somebody requests http://localhost/runIt, I would like to return data from cache that would be refreshed every 6 seconds. Below, I have a flux (always same one that is stored in map) that is first time instantiated and starts emitting numbers 0,1,2,3,4… to infinity. Is it possible to make this Spring MVC Controller