By delegating queries to separate threads or using reactive drivers.
In WebFlux, database queries are handled in a non-blocking manner by using reactive database drivers or delegating queries to a separate thread pool. This approach ensures that the main event loop is not blocked, allowing it to continue processing other requests. For example, when querying a product catalog, the query runs on a separate thread, and once complete, the result is processed back in the event loop.
Additional Notes
How does WebFlux handle database queries non-blockingly?