Interface Sinks.MulticastSpec

Enclosing class:
Sinks

public static interface Sinks.MulticastSpec
Provides multicast : 1 sink, N Subscriber
  • Method Details

    • onBackpressureBuffer

      <T> Sinks.Many<T> onBackpressureBuffer()
      A Sinks.Many with the following characteristics:

    • onBackpressureBuffer

      <T> Sinks.Many<T> onBackpressureBuffer(int bufferSize)
      A Sinks.Many with the following characteristics:
      • Multicast
      • Without Subscriber: warm up. Remembers up to bufferSize elements pushed via Sinks.Many.tryEmitNext(Object) before the first Subscriber is 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 to bufferSize:
      • Replaying: No replay of values seen by earlier subscribers. Only forwards to a Subscriber the 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

      <T> Sinks.Many<T> onBackpressureBuffer(int bufferSize, boolean autoCancel)
      A Sinks.Many with the following characteristics:
      • Multicast
      • Without Subscriber: warm up. Remembers up to bufferSize elements pushed via Sinks.Many.tryEmitNext(Object) before the first Subscriber is 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 to bufferSize:
      • Replaying: No replay of values seen by earlier subscribers. Only forwards to a Subscriber the 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
      autoCancel - should the sink fully shutdowns (not publishing anymore) when the last subscriber cancels
    • directAllOrNothing

      <T> Sinks.Many<T> directAllOrNothing()
      A Sinks.Many with the following characteristics:
      • Multicast
      • Without Subscriber: fail fast on tryEmitNext.
      • Backpressure : notify the caller with Sinks.EmitResult.FAIL_OVERFLOW if 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 Subscriber the 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.Many that "drops" in case any subscriber is too slow
    • directBestEffort

      <T> Sinks.Many<T> directBestEffort()
      A Sinks.Many with the following characteristics:
      • Multicast
      • Without Subscriber: fail fast on tryEmitNext.
      • Backpressure : notify the caller with Sinks.EmitResult.FAIL_OVERFLOW if 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 Subscriber the 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.Many that "drops" in case of no demand from any subscriber