An event loop handles many requests on relatively few threads by treating requests, callbacks, and completed operations as events. When a costly database or network operation begins, it registers a callback and continues processing other events instead of waiting. section 12.1
The event-loop approach supports reactive web applications by:
- Handling many requests per thread, generally using about one thread per CPU core. section 12.1
- Reducing per-connection and thread-management overhead under heavy request volume. section 12.1
- Allowing Spring WebFlux to process requests through a nonblocking, asynchronous model based largely on Project Reactor. section 12.1
A costly operation
A request starts an intensive database or network operation. The event loop registers a callback, handles other events, and later processes the completed operation as another event. section 12.1
Figure 12.1 Asynchronous web frameworks apply event looping to handle more requests with fewer threads.
Use the figure to visualize how asynchronous web frameworks apply event looping to handle more requests with fewer threads. section 12.1










