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

Method ambArray

src/main/java/io/reactivex/rxjava3/core/Maybe.java:153–168  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

151 * @throws NullPointerException if {@code sources} is {@code null}
152 */
153 @CheckReturnValue
154 @SchedulerSupport(SchedulerSupport.NONE)
155 @NonNull
156 @SafeVarargs
157 public static <@NonNull T> Maybe<T> ambArray(@NonNull MaybeSource<? extends T>... sources) {
158 Objects.requireNonNull(sources, "sources is null");
159 if (sources.length == 0) {
160 return empty();
161 }
162 if (sources.length == 1) {
163 @SuppressWarnings("unchecked")
164 MaybeSource<T> source = (MaybeSource<T>)sources[0];
165 return wrap(source);
166 }
167 return RxJavaPlugins.onAssembly(new MaybeAmb<>(sources, null));
168 }
169
170 /**
171 * Concatenate the single values, in a non-overlapping fashion, of the {@link MaybeSource} sources provided by

Callers 15

ambArrayOneIsNullMethod · 0.95
ambArrayEmptyMethod · 0.95
ambArrayOneMethod · 0.95
ambArrayOrderMethod · 0.95
ambArray1SignalsErrorMethod · 0.95
ambArray2SignalsErrorMethod · 0.95

Calls 3

emptyMethod · 0.95
wrapMethod · 0.95
onAssemblyMethod · 0.95

Tested by 15

ambArrayOneIsNullMethod · 0.76
ambArrayEmptyMethod · 0.76
ambArrayOneMethod · 0.76
ambArrayOrderMethod · 0.76
ambArray1SignalsErrorMethod · 0.76
ambArray2SignalsErrorMethod · 0.76