An imperative approach processes the bulk of available data as a whole. A client sends all data required for an operation to a server endpoint, which then processes it. section 17.1
Typical applications include:
- Uploading several selected files after the backend receives them all. section 17.1
- Processing a complete request payload before producing the result. section 17.1
Unlike a reactive approach, it does not process data in fragments as it arrives. It waits until the required data is available, making the distinction useful when choosing an application model. section 17.1
Milk bottling
A non-reactive factory receives all its milk in the morning and delivers the bottled orders in the evening. This models bulk processing before delivery. section 17.1
Figure 17.1 Non-reactive vs. reactive. In a non-reactive approach, the milk factory gets all the milk to be packaged in the morning and delivers all the boxes in the evening. In a reactive approach, as the milk is brought to the factory, it’s packaged and then delivered. For this scenario, a reactive approach is better as it allows milk to be collected throughout the day and delivered sooner to the clients.
Compare whole-batch processing with processing that begins as data arrives. section 17.1
