Let's examine our application, and let's see how it would look with the reactive style of programming. The following diagram depicts the flow of an application that is reactive in nature and that is completely event-driven:
In this diagram, the services are depicted by hexagons, and the events are represented by square boxes.
The flow depicted in the diagram describes the scenario of a customer who is placing an order, after having searched for the items that he/she is looking for. This is how the process goes:
- The Place order event is raised to Order service.
- In response to this event, our service analyzes the arguments, such as the order item and quantity, and it raises the Item available event to Product service.
- From here on, there are two possible outcomes: either the requested product is available and has the...