Flux is a Project Reactor publisher that emits zero or more values asynchronously.
Flux is Project Reactor’s publisher for emitting zero or more values asynchronously. Reactive endpoints return Publisher implementations such as Mono or Flux. section 17.1
Use Flux when:
An endpoint produces multiple values rather than a single result. section 17.1
Values can be collected, processed, and delivered progressively as they become available. section 17.1
Figure 17.2 In a reactive stream, a publisher produces values, and a subscriber consumes them. Contracts defined by the Reactive Streams specification describe publishers and subscribers. Project Reactor implements the Reactive Streams specification and implements the Publisher and Subscriber contracts. In the figure, the components we use in the examples in this chapter are shaded.
A reactive stream connects a publisher that produces values with a subscriber that consumes them under Reactive Streams contracts. section 17.1
How Spring Security in Action, Second Edition covers it
How deep it goes
Defines Flux as a multiple-value publisher and contrasts it with Mono, without detailing implementation internals.
Examples
Uses a milk-factory analogy in which multiple bottles are produced and delivered as milk arrives.
What it assumes
Assumes basic reactive application concepts and introduces Publisher and Subscriber as Reactive Streams contracts.
What you can do after
Evaluate/understand when a reactive endpoint requires a publisher for multiple values instead of a single value.
How it connects
Links Project Reactor with Reactive Streams, Publisher, Subscriber, Mono, and reactive web applications.
producerkind of · A producer is an entity or process that creates or supplies values, data, messages, events, or work for another entity to consume.
allused by · An all operation returns a Boolean indicating whether every item in a collection satisfies a condition, or is truthy when no condition is specified.
bodyToFlux()produced by · bodyToFlux() is a WebClient response operation that converts a response body into a Flux of a specified type.
This explainer was generated by Manning's knowledge graph from the text of Spring Security in Action, Second Edition. The section links point to the parts of the book it draws on.