69 lines
2.7 KiB
Java
69 lines
2.7 KiB
Java
package io.reactivex;
|
|
|
|
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
|
import io.reactivex.exceptions.Exceptions;
|
|
import io.reactivex.internal.functions.Functions;
|
|
import io.reactivex.internal.functions.ObjectHelper;
|
|
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer;
|
|
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureDrop;
|
|
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureLatest;
|
|
import io.reactivex.internal.subscribers.StrictSubscriber;
|
|
import io.reactivex.plugins.RxJavaPlugins;
|
|
import org.reactivestreams.Publisher;
|
|
import org.reactivestreams.Subscriber;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class Flowable<T> implements Publisher<T> {
|
|
static final int a = Math.max(1, Integer.getInteger("rx2.buffer-size", PeripheralType.SERVO).intValue());
|
|
|
|
public static int d() {
|
|
return a;
|
|
}
|
|
|
|
public final Flowable<T> a() {
|
|
return a(d(), false, true);
|
|
}
|
|
|
|
public final Flowable<T> b() {
|
|
return RxJavaPlugins.a((Flowable) new FlowableOnBackpressureDrop(this));
|
|
}
|
|
|
|
protected abstract void b(Subscriber<? super T> subscriber);
|
|
|
|
public final Flowable<T> c() {
|
|
return RxJavaPlugins.a(new FlowableOnBackpressureLatest(this));
|
|
}
|
|
|
|
public final Flowable<T> a(int i, boolean z, boolean z2) {
|
|
ObjectHelper.a(i, "bufferSize");
|
|
return RxJavaPlugins.a(new FlowableOnBackpressureBuffer(this, i, z2, z, Functions.c));
|
|
}
|
|
|
|
@Override // org.reactivestreams.Publisher
|
|
public final void a(Subscriber<? super T> subscriber) {
|
|
if (subscriber instanceof FlowableSubscriber) {
|
|
a((FlowableSubscriber) subscriber);
|
|
} else {
|
|
ObjectHelper.a(subscriber, "s is null");
|
|
a((FlowableSubscriber) new StrictSubscriber(subscriber));
|
|
}
|
|
}
|
|
|
|
public final void a(FlowableSubscriber<? super T> flowableSubscriber) {
|
|
ObjectHelper.a(flowableSubscriber, "s is null");
|
|
try {
|
|
Subscriber<? super T> a2 = RxJavaPlugins.a(this, flowableSubscriber);
|
|
ObjectHelper.a(a2, "The RxJavaPlugins.onSubscribe hook returned a null FlowableSubscriber. Please check the handler provided to RxJavaPlugins.setOnFlowableSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
|
b(a2);
|
|
} catch (NullPointerException e) {
|
|
throw e;
|
|
} catch (Throwable th) {
|
|
Exceptions.b(th);
|
|
RxJavaPlugins.b(th);
|
|
NullPointerException nullPointerException = new NullPointerException("Actually not, but can't throw other exceptions due to RS");
|
|
nullPointerException.initCause(th);
|
|
throw nullPointerException;
|
|
}
|
|
}
|
|
}
|