The strategies we've explained so far are instances of the request/response protocol where the client makes an API call to execute a job. There are many other architectures like this, such as the event-driven API, where a system generates a series of events that other systems can listen to and receive updates from. For a client to receive events, they should be subscribed.
This is similar to callbacks in some languages, such as JavaScript, where an event loop runs continuously and collects events. This type of approach is good for non-blocking clients and servers.
A trivial example includes a client registering an HTTP endpoint with an API. The server can trigger the API as an event whenever some useful information is available. A few practical examples are as follows:
- A weather station sending a series of events to subscribed clients (for example, mobiles...