Package org.apache.juneau.rest.server.reactive
@RestOp handlers (opt-in, dependency-free).
This package is the JDK-native spine that lets @RestOp handlers return reactive values. It
ships in the opt-in juneau-rest-server-reactive module — a bare juneau-rest-server
has no reactive behavior and DefaultConfig does not wire any reactive processor. Merely
placing this module on the classpath auto-registers ReactiveResponseProcessor
via a META-INF/services/org.apache.juneau.rest.server.processor.ResponseProcessor provider file, which
RestContext discovers through ServiceLoader and front-loads ahead of
AsyncResponseProcessor.
The processor handles Flow.Publisher<T> directly (no
external dependency) and exposes the ReactiveStreamsAdapter SPI
so the further opt-in juneau-rest-server-reactive-reactor module can plug in Project Reactor, RxJava 3,
and Reactive-Streams Publisher support without duplicating any of the streaming / buffering /
SSE / NDJSON plumbing.
Key types
ReactiveResponseProcessor— the response processor (auto-registered viaServiceLoader, front-loaded ahead ofAsyncResponseProcessor).ReactiveStreamsAdapter— theServiceLoaderSPI bridge modules implement.Adaptation— the single-value / streaming result of an adapter.
See Also:
- Since:
- 10.0.0
-
ClassDescriptionThe result of a
ReactiveStreamsAdapter.adapt(...)call: either a single-valueCompletionStageor a multi-valueFlow.Publisher.Response processor that bridges Reactive Streams return values from@RestOphandlers to Juneau's response pipeline.SPI that bridges a third-party reactive return type to one of the two JDK-native shapes that theReactiveResponseProcessorunderstands: aCompletionStage(single value) or aFlow.Publisher(a stream of values).