Package reactor.core.publisher
Interface Sinks.MulticastSpec
- Enclosing class:
- Sinks
public static interface Sinks.MulticastSpec
Provides multicast : 1 sink, N
Subscriber-
Method Summary
Modifier and TypeMethodDescription<T> Sinks.Many<T>ASinks.Manywith the following characteristics: Multicast WithoutSubscriber: fail fast ontryEmitNext. Backpressure : notify the caller withSinks.EmitResult.FAIL_OVERFLOWif any of the subscribers cannot process an element, failing fast and backing off from emitting the element at all (all or nothing).<T> Sinks.Many<T>ASinks.Manywith the following characteristics: Multicast WithoutSubscriber: fail fast ontryEmitNext. Backpressure : notify the caller withSinks.EmitResult.FAIL_OVERFLOWif none of the subscribers can process an element.<T> Sinks.Many<T>ASinks.Manywith the following characteristics: Multicast WithoutSubscriber: warm up.<T> Sinks.Many<T>onBackpressureBuffer(int bufferSize) ASinks.Manywith the following characteristics: Multicast WithoutSubscriber: warm up.<T> Sinks.Many<T>onBackpressureBuffer(int bufferSize, boolean autoCancel) ASinks.Manywith the following characteristics: Multicast WithoutSubscriber: warm up.
-
Method Details
-
onBackpressureBuffer
ASinks.Manywith 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.
-
onBackpressureBuffer
ASinks.Manywith 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 size
-
onBackpressureBuffer
ASinks.Manywith 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
-
directAllOrNothing
ASinks.Manywith the following characteristics:- Multicast
- Without
Subscriber: fail fast ontryEmitNext. - Backpressure : notify the caller with
Sinks.EmitResult.FAIL_OVERFLOWif any of the subscribers cannot process an element, failing fast and backing off from emitting the element at all (all or nothing). From the perspective of subscribers, data is dropped and never seen but they are not terminated. - Replaying: No replay of elements. Only forwards to a
Subscriberthe elements that have been pushed to the sink AFTER this subscriber was subscribed, provided all of the subscribers have demand.
- Type Parameters:
T- the type of elements to emit- Returns:
- a multicast
Sinks.Manythat "drops" in case any subscriber is too slow
-
directBestEffort
ASinks.Manywith the following characteristics:- Multicast
- Without
Subscriber: fail fast ontryEmitNext. - Backpressure : notify the caller with
Sinks.EmitResult.FAIL_OVERFLOWif none of the subscribers can process an element. Otherwise, it ignores slow subscribers and emits the element to fast ones as a best effort. From the perspective of slow subscribers, data is dropped and never seen, but they are not terminated. - Replaying: No replay of elements. Only forwards to a
Subscriberthe elements that have been pushed to the sink AFTER this subscriber was subscribed.
- Type Parameters:
T- the type of elements to emit- Returns:
- a multicast
Sinks.Manythat "drops" in case of no demand from any subscriber
-