To use an operator (a method of Mono/Flux/Flowable object that returns a Mono/Flux/Flowable) that produces a new
Publisher instance, you must subscribe to the created
Using a factory (for example,
Mono.just()) without subscribing to the returned
Publisher, creates an object that is never used and is treated as unnecessary memory allocation.
Mono.just(1, 2, 3).map(i -> i + 3) won't be executed unless you subscribe to this
Publisher, or unless you produce a new
Publisher by applying operators and subscribe to it.
Flux instance used by consumer:
Calls to methods annotated with Error Prone's or AssertJ's
@CanIgnoreReturnValue annotation are not reported.
New in 2019.3
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3
Reactive Streams, 233.SNAPSHOT