Interface ConditionalSubscriber<T>

Type Parameters:
T - the value type
All Superinterfaces:
Flow.Subscriber<T>, FlowableSubscriber<T>

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 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