jimu-decompiled/sources/io/reactivex/internal/operators/observable/ObservableReduceWithSingle.java
2025-05-13 19:24:51 +02:00

37 lines
1.4 KiB
Java

package io.reactivex.internal.operators.observable;
import io.reactivex.ObservableSource;
import io.reactivex.Single;
import io.reactivex.SingleObserver;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.BiFunction;
import io.reactivex.internal.disposables.EmptyDisposable;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.operators.observable.ObservableReduceSeedSingle;
import java.util.concurrent.Callable;
/* loaded from: classes2.dex */
public final class ObservableReduceWithSingle<T, R> extends Single<R> {
final ObservableSource<T> a;
final Callable<R> b;
final BiFunction<R, ? super T, R> c;
public ObservableReduceWithSingle(ObservableSource<T> observableSource, Callable<R> callable, BiFunction<R, ? super T, R> biFunction) {
this.a = observableSource;
this.b = callable;
this.c = biFunction;
}
@Override // io.reactivex.Single
protected void b(SingleObserver<? super R> singleObserver) {
try {
R call = this.b.call();
ObjectHelper.a(call, "The seedSupplier returned a null value");
this.a.subscribe(new ObservableReduceSeedSingle.ReduceSeedObserver(singleObserver, this.c, call));
} catch (Throwable th) {
Exceptions.b(th);
EmptyDisposable.error(th, singleObserver);
}
}
}