Package reactor.core.publisher
Interface Sinks.ManyWithUpstream<T>
- Type Parameters:
T- the type of data emitted by the sink
- All Superinterfaces:
Scannable,Sinks.Many<T>
- All Known Implementing Classes:
EmitterProcessor
- Enclosing class:
- Sinks
A
Sinks.Many which additionally allows being subscribed to an upstream Publisher,
which is an advanced pattern requiring external synchronization. See subscribeTo(Publisher)} for more details.-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Scannable
Scannable.Attr<T> -
Field Summary
Fields inherited from interface reactor.core.Scannable
OPERATOR_NAME_UNRELATED_WORDS_PATTERN -
Method Summary
Modifier and TypeMethodDescriptionsubscribeTo(Publisher<? extends T> upstream) Explicitly subscribe thisSinks.Manyto an upstreamPublisherwithout exposing it as aSubscriberat all.Methods inherited from interface reactor.core.Scannable
actuals, inners, isScanAvailable, name, parents, scan, scanOrDefault, scanUnsafe, stepName, steps, tags, tagsDeduplicatedMethods inherited from interface reactor.core.publisher.Sinks.Many
asFlux, currentSubscriberCount, emitComplete, emitError, emitNext, tryEmitComplete, tryEmitError, tryEmitNext
-
Method Details
-
subscribeTo
Explicitly subscribe thisSinks.Manyto an upstreamPublisherwithout exposing it as aSubscriberat all.Note that when this is done, one MUST stop using emit/tryEmit APIs, reserving signal creation to be the sole responsibility of the upstream
Publisher.The returned
Disposableprovides a way of both unsubscribing from the upstream and terminating the sink: currently registered subscribers downstream receive anonErrorsignal with aCancellationExceptionand further attempts at subscribing to the sink will trigger a similar signal immediately (in which case the returnedDisposablemight be no-op).Any attempt at subscribing the same
Sinks.ManyWithUpstreammultiple times throws anIllegalStateExceptionindicating that the subscription must be unique.
-