Package reactor.core.publisher
Interface Sinks.RootSpec
- Enclosing class:
- Sinks
public static interface Sinks.RootSpec
-
Method Summary
Modifier and TypeMethodDescription<T> Sinks.Empty<T>empty()ASinks.Emptywhich exclusively produces one terminal signal: error or complete.many()Help buildingSinks.Manysinks that will broadcast multiple signals to one or moreSubscriber.<T> Sinks.One<T>one()ASinks.Onethat works like a conceptual promise: it can be completed with or without a value at any time, but only once.
-
Method Details
-
empty
ASinks.Emptywhich exclusively produces one terminal signal: error or complete. It has the following characteristics:- Multicast
- Backpressure : this sink does not need any demand since it can only signal error or completion
- Replaying: Replay the terminal signal (error or complete).
Sinks.Empty.asMono()to expose theMonoview of the sink to downstream consumers. -
one
ASinks.Onethat works like a conceptual promise: it can be completed with or without a value at any time, but only once. This completion is replayed to late subscribers. CallingSinks.One.emitValue(Object, Sinks.EmitFailureHandler)(orSinks.One.tryEmitValue(Object)) is enough and will implicitly produce aSubscriber.onComplete()signal as well.Use
Sinks.Empty.asMono()to expose theMonoview of the sink to downstream consumers. -
many
Sinks.ManySpec many()Help buildingSinks.Manysinks that will broadcast multiple signals to one or moreSubscriber.Use
Sinks.Many.asFlux()to expose theFluxview of the sink to the downstream consumers.- Returns:
Sinks.ManySpec
-
manyWithUpstream
Sinks.ManyWithUpstreamUnsafeSpec manyWithUpstream()Help buildingSinks.ManyWithUpstreamsinks that can also besubscribed toan upstreamPublisher. This is an advanced use case, seeSinks.ManyWithUpstream.subscribeTo(Publisher).- Returns:
- a
Sinks.ManyWithUpstreamUnsafeSpec
-