72 lines
1.9 KiB
Java
72 lines
1.9 KiB
Java
package j0.l.a;
|
|
|
|
import j0.k.b;
|
|
import j0.o.l;
|
|
import rx.Observable;
|
|
import rx.Producer;
|
|
import rx.Subscriber;
|
|
import rx.exceptions.OnErrorThrowable;
|
|
/* compiled from: OnSubscribeMap */
|
|
public final class s<T, R> implements Observable.a<R> {
|
|
public final Observable<T> i;
|
|
public final b<? super T, ? extends R> j;
|
|
|
|
/* compiled from: OnSubscribeMap */
|
|
public static final class a<T, R> extends Subscriber<T> {
|
|
public final Subscriber<? super R> i;
|
|
public final b<? super T, ? extends R> j;
|
|
public boolean k;
|
|
|
|
public a(Subscriber<? super R> subscriber, b<? super T, ? extends R> bVar) {
|
|
this.i = subscriber;
|
|
this.j = bVar;
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onCompleted() {
|
|
if (!this.k) {
|
|
this.i.onCompleted();
|
|
}
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onError(Throwable th) {
|
|
if (this.k) {
|
|
l.b(th);
|
|
return;
|
|
}
|
|
this.k = true;
|
|
this.i.onError(th);
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onNext(T t) {
|
|
try {
|
|
this.i.onNext(this.j.call(t));
|
|
} catch (Throwable th) {
|
|
c.q.a.k.a.a0(th);
|
|
unsubscribe();
|
|
onError(OnErrorThrowable.a(th, t));
|
|
}
|
|
}
|
|
|
|
@Override // rx.Subscriber
|
|
public void setProducer(Producer producer) {
|
|
this.i.setProducer(producer);
|
|
}
|
|
}
|
|
|
|
public s(Observable<T> observable, b<? super T, ? extends R> 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.i0(aVar);
|
|
}
|
|
}
|