The EmitterProcessor type

EmitterProcessor is a processor that can be used with several subscribers. Multiple subscribers can ask for the next value event, based on their individual rate of consumption. The processor provides the necessary backpressure support for each subscriber. This is depicted in the following diagram:

The processor is also capable of publishing events from an external publisher. It consumes an event from the injected publisher and synchronously passes it to the subscribers.

Let's look at the following code:

EmitterProcessor<Long> data = EmitterProcessor.create(1);data.subscribe(t -> System.out.println(t));FluxSink<Long> ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.