Reactive programming organizes asynchronous work as tasks with declared dependencies. Instead of keeping a thread waiting during I/O, the application can let available threads execute other tasks. section 11.4
The practical distinction is how an application handles a flow of work:
- In a nonreactive flow, one thread performs the tasks in sequence and waits when a task blocks on I/O. section 11.4
- In a reactive flow, tasks declare dependencies; available threads can work on independent tasks instead of staying idle. section 11.4
- Choose WebClient for a reactive app; for a nonreactive app, use RestClient or OpenFeign instead. section 11.6
A banking debt calculation
To calculate a customer's total debt, an application may call several services, including services for external and internal credit. In a sequential flow, waiting for those calls can block the thread. A reactive design represents work as dependent tasks so other available threads can make progress. section 11.4
Calling a payment endpoint
A Spring proxy can use WebClient to POST a payment and return a Mono<Payment>. The returned task participates in a dependency chain; WebFlux subscribes to the task returned by the controller, and WebClient subscribes to the task that supplies the request body. section 11.4
Figure 11.8 An analogy of the way a reactive app works. A thread doesn’t take a request’s tasks in order and wait when it’s blocked. Instead, all tasks from all requests are on a backlog. Any available thread can work on tasks from any request. This way, independent tasks can be solved in parallel, and the threads don’t stay idle.

Visualizes the task backlog: available threads can take work from different requests rather than wait on blocked operations. section 11.4







