Class BroadcastProcessor<T>
- All Implemented Interfaces:
Multi<T>,Flow.Processor<T,,T> Flow.Publisher<T>,Flow.Subscriber<T>
Flow.Processor that broadcast all subsequently observed items to its current
Flow.Subscribers.
This processor does not coordinate back-pressure between different subscribers and between the upstream source and a
subscriber. If an upstream item is received via onNext(Object), if a subscriber is not ready to receive that
item, that subscriber is terminated via a BackPressureFailure.
The BroadcastProcessor's Flow.Subscriber-side consumes items in an unbounded manner.
When this BroadcastProcessor is terminated via onError(Throwable) or onComplete(), late
Flow.Subscribers only receive the respective terminal event.
Unlike the UnicastProcessor, a BroadcastProcessor doesn't retain/cache items, therefore, a new
Subscriber won't receive any past items.
Even though BroadcastProcessor implements the Flow.Subscriber interface, calling onSubscribe is
not required if the processor is used as a standalone source. However, calling onSubscribe after
the BroadcastProcessor has failed or reached completion results in the given Flow.Subscription being
canceled immediately.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BroadcastProcessor<T> create()Creates a newBroadcastProcessorvoidvoidvoidvoidonSubscribe(Flow.Subscription subscription) voidsubscribe(MultiSubscriber<? super T> downstream) Methods inherited from class io.smallrye.mutiny.operators.AbstractMulti
broadcast, cache, capDemandsUsing, collect, convert, emitOn, emitOn, group, ifNoItem, log, log, onCancellation, onCompletion, onFailure, onFailure, onFailure, onItem, onOverflow, onRequest, onSubscription, onTermination, paceDemand, pauseDemand, runSubscriptionOn, select, skip, subscribe, subscribe, toHotStream, toUni, withContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Flow.Publisher
subscribe
-
Method Details
-
create
Creates a newBroadcastProcessor- Type Parameters:
T- the type of item- Returns:
- the new
BroadcastProcessor
-
serialized
-
subscribe
- Overrides:
subscribein classAbstractMulti<T>
-
onSubscribe
- Specified by:
onSubscribein interfaceFlow.Subscriber<T>
-
onNext
- Specified by:
onNextin interfaceFlow.Subscriber<T>
-
onError
- Specified by:
onErrorin interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-