Utility methods

Flux offers methods to generate infinite streams and empty streams, or to convert an existing Reactive Stream publisher to Flux. These methods are required to generate streams that can be combined with other streams, using the available operators, as follows:

  • Flux.empty: This method generates an empty stream with no values and only completion.
  • Flux.error: This method generates an error stream with no values and only specified errors.
  • Flux.never: This method generates a stream with no events at all. It does not generate events of any type.
  • Flux.from: This method takes an existing reactive publisher and generates a Flux from it.
  • Flux.defer: This method is used to build a lazy reactive publisher. The method takes a Java 8 supplier ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.