The window operator

The window() operator is similar to the buffer() operator. It also slices the original dataset, but emits each dataset as a processor, rather than as a new collection. Each processor serves as a publisher and emits items after subscribing to themThe window operator allows us to have a fixed window size, a time-based window, or a predicate-based window. Unlike the buffer operator, which allows us to build a single buffer for all published elements, the window operator does not allow you to publish elements in a single window.

The window() operator offers better memory utilization, as the items are emitted immediately rather than first being cached to a collection and then emitted once the correct collection size is achieved.  ...

Get Hands-On Reactive Programming with Reactor now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.