Events and notifications
The two primary interactions we've examined in detail so far in this chapter have been to query the ledger and submit new transactions. The final class of interaction is to listen for ledger notifications. These notifications complement query and submit operations; let's explore when and how to use them.
Unlike querying and submiting, which are fundamentally synchronous in nature, listening for an event is an asynchronous activity. That's because an application can register for a notification at any time, but when and whether a notification is received is outside the control of the listening application.
Let's see how applications in our network can exploit event notification:
Figure 7.16: Applications can receive notifications as the ledger changes
In Figure 7.16, we have expanded the vehicle-registration
network to include notification applications as follows:
- Yogendra, from
organization
B
, is running...