Utility methods

Mono offers methods to generate empty/error streams or to convert an existing Reactive Stream publisher to Mono. These methods are required to generate streams that can be combined with others by using the available operators, as follows:

  • Mono.empty: Generates a stream with no value and only a completion.
  • Mono.error: Generates a stream with no value and only a specified error.
  • Mono.never: Generates a stream with no events at all. It does not generate an event of any type.
  • Mono.from: Generates a Mono stream from an existing stream publisher.
  • Mono.defer: This method is used to build a lazy reactive publisher. It also takes a Java 8 supplier to instantiate a subscription-specific Reactive Stream publisher. The publisher instance ...

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.