77 lines
2 KiB
Java
77 lines
2 KiB
Java
|
package j0.l.a;
|
||
|
|
||
|
import j0.k.b;
|
||
|
import rx.Observable;
|
||
|
import rx.Producer;
|
||
|
import rx.Subscriber;
|
||
|
import rx.exceptions.OnErrorThrowable;
|
||
|
/* compiled from: OnSubscribeFilter */
|
||
|
public final class l<T> implements Observable.a<T> {
|
||
|
public final Observable<T> i;
|
||
|
public final b<? super T, Boolean> j;
|
||
|
|
||
|
/* compiled from: OnSubscribeFilter */
|
||
|
public static final class a<T> extends Subscriber<T> {
|
||
|
public final Subscriber<? super T> i;
|
||
|
public final b<? super T, Boolean> j;
|
||
|
public boolean k;
|
||
|
|
||
|
public a(Subscriber<? super T> subscriber, b<? super T, Boolean> bVar) {
|
||
|
this.i = subscriber;
|
||
|
this.j = bVar;
|
||
|
request(0);
|
||
|
}
|
||
|
|
||
|
@Override // j0.g
|
||
|
public void onCompleted() {
|
||
|
if (!this.k) {
|
||
|
this.i.onCompleted();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // j0.g
|
||
|
public void onError(Throwable th) {
|
||
|
if (this.k) {
|
||
|
j0.o.l.b(th);
|
||
|
return;
|
||
|
}
|
||
|
this.k = true;
|
||
|
this.i.onError(th);
|
||
|
}
|
||
|
|
||
|
@Override // j0.g
|
||
|
public void onNext(T t) {
|
||
|
try {
|
||
|
if (this.j.call(t).booleanValue()) {
|
||
|
this.i.onNext(t);
|
||
|
} else {
|
||
|
request(1);
|
||
|
}
|
||
|
} catch (Throwable th) {
|
||
|
c.q.a.k.a.Z(th);
|
||
|
unsubscribe();
|
||
|
onError(OnErrorThrowable.a(th, t));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // rx.Subscriber
|
||
|
public void setProducer(Producer producer) {
|
||
|
super.setProducer(producer);
|
||
|
this.i.setProducer(producer);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public l(Observable<T> observable, b<? super T, Boolean> bVar) {
|
||
|
this.i = observable;
|
||
|
this.j = bVar;
|
||
|
}
|
||
|
|
||
|
@Override // rx.functions.Action1
|
||
|
public void call(Object obj) {
|
||
|
Subscriber subscriber = (Subscriber) obj;
|
||
|
a aVar = new a(subscriber, this.j);
|
||
|
subscriber.add(aVar);
|
||
|
this.i.j0(aVar);
|
||
|
}
|
||
|
}
|