The Flux.from methods

The From methods can be used to generate a Flux from various sources, such as arrays, collections, and so on. In this case, all of the values are identified as multi-valued datasets beforehand. The generated Flux publishes the value events for each value in the original dataset, followed by a completion event. The offered methods have the following variants:

  • Flux.fromArray: This is used to build a stream from an array of a type.
  • Flux.fromIterable: This is used to build a stream from collections. All collections are of the Iterable<T> type, which can be passed to this to generate the intended stream.
  • Flux.fromStream: This is used to build a Flux from an existing Java 8 stream or a Java 8 stream supplier. Consider the ...

Get Hands-On Reactive Programming with Reactor now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.