85 lines
2.8 KiB
Java
85 lines
2.8 KiB
Java
|
package o;
|
||
|
|
||
|
import io.reactivex.rxjava3.exceptions.CompositeException;
|
||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||
|
|
||
|
/* renamed from: o.fWV, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public final class C13291fWV<T> extends fUX<T, T> {
|
||
|
private fSN<? super Integer, ? super Throwable> d;
|
||
|
|
||
|
public C13291fWV(AbstractC13163fSk<T> abstractC13163fSk, fSN<? super Integer, ? super Throwable> fsn) {
|
||
|
super(abstractC13163fSk);
|
||
|
this.d = fsn;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC13163fSk
|
||
|
public final void subscribeActual(InterfaceC13174fSv<? super T> interfaceC13174fSv) {
|
||
|
C13197fTk c13197fTk = new C13197fTk();
|
||
|
interfaceC13174fSv.onSubscribe(c13197fTk);
|
||
|
new Sts(interfaceC13174fSv, this.d, c13197fTk, this.c).c();
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.fWV$Sts */
|
||
|
/* loaded from: classes6.dex */
|
||
|
static final class Sts<T> extends AtomicInteger implements InterfaceC13174fSv<T> {
|
||
|
private InterfaceC13174fSv<? super T> a;
|
||
|
private int b;
|
||
|
private InterfaceC13169fSq<? extends T> c;
|
||
|
private fSN<? super Integer, ? super Throwable> d;
|
||
|
private C13197fTk e;
|
||
|
|
||
|
Sts(InterfaceC13174fSv<? super T> interfaceC13174fSv, fSN<? super Integer, ? super Throwable> fsn, C13197fTk c13197fTk, InterfaceC13169fSq<? extends T> interfaceC13169fSq) {
|
||
|
this.a = interfaceC13174fSv;
|
||
|
this.e = c13197fTk;
|
||
|
this.c = interfaceC13169fSq;
|
||
|
this.d = fsn;
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onNext(T t) {
|
||
|
this.a.onNext(t);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onError(Throwable th) {
|
||
|
try {
|
||
|
fSN<? super Integer, ? super Throwable> fsn = this.d;
|
||
|
int i = this.b + 1;
|
||
|
this.b = i;
|
||
|
if (!fsn.d(Integer.valueOf(i), th)) {
|
||
|
this.a.onError(th);
|
||
|
} else {
|
||
|
c();
|
||
|
}
|
||
|
} catch (Throwable th2) {
|
||
|
C13147fSI.c(th2);
|
||
|
this.a.onError(new CompositeException(th, th2));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onComplete() {
|
||
|
this.a.onComplete();
|
||
|
}
|
||
|
|
||
|
final void c() {
|
||
|
if (getAndIncrement() == 0) {
|
||
|
int i = 1;
|
||
|
while (!this.e.isDisposed()) {
|
||
|
this.c.subscribe(this);
|
||
|
i = addAndGet(-i);
|
||
|
if (i == 0) {
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onSubscribe(fSJ fsj) {
|
||
|
EnumC13192fTf.c(this.e, fsj);
|
||
|
}
|
||
|
}
|
||
|
}
|