Package reactor.core.publisher
Interface Sinks.ManyWithUpstreamUnsafeSpec
- Enclosing class:
- Sinks
public static interface Sinks.ManyWithUpstreamUnsafeSpec
Instead of
unsafe flavors of Sinks.Many, this spec provides Sinks.ManyWithUpstream
implementations. These additionally support being subscribed to an upstream Publisher, at most once.
Please 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.
As the number of such implementations is deliberately kept low, this spec doesn't further distinguish between multicast/unicast/replay categories other than in method naming.
-
Method Summary
Modifier and TypeMethodDescription<T> Sinks.ManyWithUpstream<T>ASinks.ManyWithUpstreamwith the following characteristics: Multicast WithoutSubscriber: warm up.<T> Sinks.ManyWithUpstream<T>multicastOnBackpressureBuffer(int bufferSize, boolean autoCancel) ASinks.ManyWithUpstreamwith the following characteristics: Multicast WithoutSubscriber: warm up.
-
Method Details
-
multicastOnBackpressureBuffer
ASinks.ManyWithUpstreamwith the following characteristics:- Multicast
- Without
Subscriber: warm up. Remembers up toQueues.SMALL_BUFFER_SIZEelements pushed viaSinks.Many.tryEmitNext(Object)before the firstSubscriberis registered. - Backpressure : this sink honors downstream demand by conforming to the lowest demand in case
of multiple subscribers.
If the difference between multiple subscribers is greater thanQueues.SMALL_BUFFER_SIZE:tryEmitNextwill returnSinks.EmitResult.FAIL_OVERFLOWemitNextwill terminate the sink byemittinganoverflow error.
- Replaying: No replay of values seen by earlier subscribers. Only forwards to a
Subscriberthe elements that have been pushed to the sink AFTER this subscriber was subscribed, or elements that have been buffered due to backpressure/warm up.
-
multicastOnBackpressureBuffer
ASinks.ManyWithUpstreamwith the following characteristics:- Multicast
- Without
Subscriber: warm up. Remembers up tobufferSizeelements pushed viaSinks.Many.tryEmitNext(Object)before the firstSubscriberis registered. - Backpressure : this sink honors downstream demand by conforming to the lowest demand in case
of multiple subscribers.
If the difference between multiple subscribers is too high compared tobufferSize:tryEmitNextwill returnSinks.EmitResult.FAIL_OVERFLOWemitNextwill terminate the sink byemittinganoverflow error.
- Replaying: No replay of values seen by earlier subscribers. Only forwards to a
Subscriberthe elements that have been pushed to the sink AFTER this subscriber was subscribed, or elements that have been buffered due to backpressure/warm up.
- Parameters:
bufferSize- the maximum queue sizeautoCancel- should the sink fully shutdowns (not publishing anymore) when the last subscriber cancels
-