He is currently experimenting with reactive programming with Spring 5.0.0.RC2 , Reactor 3.1.0.M2, and Spring Download 2.0.0.M2 .
Think about the concurrency and stream model used by WebFlux and Reactor to properly encode the application and handle mutable state.
The Reactor document states that the library is considered concurrency agnostic and mentions an abstraction of the Scheduler. The WebFlux document does not provide information.
However, when using WebFlux through Spring Boot, a streaming model is defined.
From my experiments, this is what I got:
- The model is not a single event, not a single event thread + workers
- Multiple thread pools used
- "reactor-http-nio-3": perhaps one per core, processes incoming HTTP requests.
- "Thread-7" threads: used by async requests for MongoDB or HTTP resources.
- "parallel-1": one per core created by Schedulers.parallel () from Reactor, used by delay operators and such
- Shared mutable state must be synchronized by the application
- ThreadLocal (for application state, MDC logging, etc.) does not ask for scope, so itβs not very interesting
It is right? What is concurrency and the WebFlux stream model: for example, what are the default thread pools?
thanks for the information
source share