Converts an array into a Publisher that emits the items in the array. Backpressure: The operator honors backpressure from downstream and ite
(@NonNull T... items)
| 2183 | * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a> |
| 2184 | */ |
| 2185 | @CheckReturnValue |
| 2186 | @NonNull |
| 2187 | @BackpressureSupport(BackpressureKind.FULL) |
| 2188 | @SchedulerSupport(SchedulerSupport.NONE) |
| 2189 | @SafeVarargs |
| 2190 | public static <@NonNull T> Flowable<T> fromArray(@NonNull T... items) { |
| 2191 | Objects.requireNonNull(items, "items is null"); |
| 2192 | if (items.length == 0) { |
| 2193 | return empty(); |
| 2194 | } |
| 2195 | if (items.length == 1) { |
| 2196 | return just(items[0]); |
| 2197 | } |
| 2198 | return RxJavaPlugins.onAssembly(new FlowableFromArray<>(items)); |
| 2199 | } |
| 2200 | |
| 2201 | /** |
| 2202 | * Returns a {@code Flowable} that, when a {@link Subscriber} subscribes to it, invokes a function you specify and then |