Runs multiple MaybeSources and signals the events of the first one that signals (disposing the rest). Scheduler: ambArray does
(@NonNull MaybeSource<? extends T>... sources)
| 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 |