Interface ConditionalSubscriber<T>

Type Parameters:
T - the value type
All Superinterfaces:
FlowableSubscriber<T>, org.reactivestreams.Subscriber<T>
All Known Implementing Classes:
BasicFuseableConditionalSubscriber

public interface ConditionalSubscriber<@NonNull T> extends FlowableSubscriber<T>
A FlowableSubscriber with an additional tryOnNext(Object) method that tells the caller the specified value has been accepted or not.

This allows certain queue-drain or source-drain operators to avoid requesting 1 on behalf of a dropped value.

Since:
3.1.1
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Conditionally takes the value.

    Methods inherited from interface FlowableSubscriber

    onSubscribe

    Methods inherited from interface org.reactivestreams.Subscriber

    onComplete, onError, onNext
  • Method Details

    • tryOnNext

      boolean tryOnNext(@NonNull @NonNull T t)
      Conditionally takes the value.
      Parameters:
      t - the value to deliver
      Returns:
      true if the value has been accepted, false if the value has been rejected and the next value can be sent immediately