O'Reilly logo

Hands-On Reactive Programming with Reactor by Rahul Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The replay operator

Reactor provides the replay operator to convert a Flux to a ConnectableFlux. The resulting ConnectableFlux keeps buffering events published to the first subscriber. The buffer can be configured to keep the last n entries, or it can be configured to be based on the time duration. Only the buffered events are replayed back to the subscribers.

Refer to the following diagram:

A ConnectableFlux must be subscribed by n subscribers before it starts to publish events. ConnectableFlux provides the following operators to manage subscribers:

  • Connect: The connect operator must be invoked after enough subscriptions have been made. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required