MCPcopy Index your code
hub / github.com/ReactiveX/RxJava / ambArray

Method ambArray

src/main/java/io/reactivex/rxjava3/core/Single.java:158–173  ·  view source on GitHub ↗

Runs multiple SingleSources and signals the events of the first one that signals (disposing the rest). Scheduler: ambArray

(@NonNull SingleSource<? extends T>... sources)

Source from the content-addressed store, hash-verified

156 * @since 2.0
157 */
158 @CheckReturnValue
159 @SchedulerSupport(SchedulerSupport.NONE)
160 @SafeVarargs
161 @NonNull
162 public static <@NonNull T> Single<T> ambArray(@NonNull SingleSource<? extends T>... sources) {
163 Objects.requireNonNull(sources, "sources is null");
164 if (sources.length == 0) {
165 return error(SingleInternalHelper.emptyThrower());
166 }
167 if (sources.length == 1) {
168 @SuppressWarnings("unchecked")
169 SingleSource<T> source = (SingleSource<T>)sources[0];
170 return wrap(source);
171 }
172 return RxJavaPlugins.onAssembly(new SingleAmb<>(sources, null));
173 }
174
175 /**
176 * Concatenate the single values, in a non-overlapping fashion, of the {@link SingleSource}s provided by

Callers 11

ambArrayEmptyMethod · 0.95
ambSingleSourceMethod · 0.95
errorMethod · 0.95
nullSourceSuccessRaceMethod · 0.95
multipleErrorRaceMethod · 0.95
successErrorRaceMethod · 0.95
ambArrayOrderMethod · 0.95
noWinnerErrorDisposeMethod · 0.95
ambArrayOneIsNullMethod · 0.95
ambWithMethod · 0.95

Calls 4

errorMethod · 0.95
emptyThrowerMethod · 0.95
wrapMethod · 0.95
onAssemblyMethod · 0.95

Tested by 10

ambArrayEmptyMethod · 0.76
ambSingleSourceMethod · 0.76
errorMethod · 0.76
nullSourceSuccessRaceMethod · 0.76
multipleErrorRaceMethod · 0.76
successErrorRaceMethod · 0.76
ambArrayOrderMethod · 0.76
noWinnerErrorDisposeMethod · 0.76
ambArrayOneIsNullMethod · 0.76