Flux#fromArray() can be used to create an instance that emits the items contained in the provided array.
public static <T> Flux<T> fromArray(T[] array)
package com.logicbig.example; import reactor.core.publisher.Flux; public class FluxFromArrayExamples { public static void main(String[] args) { System.out.println("-- Flux#fromArray example --"); Integer[] integers = {1, 3, 5}; Flux.fromArray(integers) .subscribe(System.out::println); } }
-- Flux#fromArray example --135
Dependencies and Technologies Used: