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