Dealing with time
Reactive programming is asynchronous, so it inherently assumes the presence of the arrow of time.
With Project Reactor, we can generate events based on a duration with the interval operator, delay elements with the delayElements operator, and delay all signals with the delaySequence operator. In this chapter, we have already used a couple of these operators.
We have already discussed how data buffering and windowing can happen based on configured timeouts (the buffer(Duration) and window(Window) operators). Reactor's API allows you to react to some time-related events, such as with the previously described timestamp and timeout operators. Similar to timestamp, the elapsed operator measures the time interval from the previous ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access