Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources in the array as a Flowable sequence. Backpressur
(@NonNull MaybeSource<? extends T>... sources)
| 366 | * @throws NullPointerException if {@code sources} is {@code null} |
| 367 | */ |
| 368 | @BackpressureSupport(BackpressureKind.FULL) |
| 369 | @CheckReturnValue |
| 370 | @NonNull |
| 371 | @SchedulerSupport(SchedulerSupport.NONE) |
| 372 | @SafeVarargs |
| 373 | public static <@NonNull T> Flowable<T> concatArray(@NonNull MaybeSource<? extends T>... sources) { |
| 374 | Objects.requireNonNull(sources, "sources is null"); |
| 375 | if (sources.length == 0) { |
| 376 | return Flowable.empty(); |
| 377 | } |
| 378 | if (sources.length == 1) { |
| 379 | @SuppressWarnings("unchecked") |
| 380 | MaybeSource<T> source = (MaybeSource<T>)sources[0]; |
| 381 | return RxJavaPlugins.onAssembly(new MaybeToFlowable<>(source)); |
| 382 | } |
| 383 | return RxJavaPlugins.onAssembly(new MaybeConcatArray<>(sources)); |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * Concatenates a variable number of {@link MaybeSource} sources and delays errors from any of them |