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 O’Reilly online learning.

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