- Spring 5.0 Microservices(Second Edition)
- Rajesh R V
- 79字
- 2025-04-04 18:53:35
Processor
A Processor represents a processing stage--which is both a Subscriber and a Publisher, and MUST obey the contracts of both. A of can be chained by connecting a Publisher and Subscriber:
public interface Processor<T, R> extends Subscriber<T>,
Publisher<R> {
}
Reactor has two implementations for Publisher--Flux and Mono. Flux can emit 0...N events, whereas, Mono is for a single event (0...1). Flux is required when many data elements or a list of values is transmitted as Streams.