'Is Nonblocking IO in Project Reactor really nonblocking?
I have created the diagram below. I am just not able to understand that how threads are not blocked in case of Spring Webflux/Project Reactor.
In the below image, request came to my Netty server and one of the threads (reactor-http-nio-1) was assigned to the request, it passed on the flow and then became available for next work.
After sometime, response came and was assigned to Thread2 (reactor-http-nio-2). It was returned to the client.
But there has to be something, right, which should wait for the response, (or be in blocking state), or something that wakes up when response is received and it knows it have to assign a thread to the response and then thread returns response to their respective client who made that request, to prevent interleaving.
Is my understanding correct that blocking is still involved, but we have just offloaded the process of blocking to some other thread (internal maybe). Or is the system made capable enough to go in dormant state after passing on the request and waking back up only when response arrives. If latter is the case, how does this mechanism work?
This question may be too broad, but some resource or explanation will be really helpful for clarification.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

