chapter five
This chapter covers:
- what are the limitations of callbacks, illustrated with a edge service example, and
- alternative asynchronous programming models with reactive extensions, coroutines, promises and futures.
While callbacks are a simple form of asynchronous event notification, they can easily render asynchronous code complicated.
We are going to take the example of a edge service to illustrate composing asynchronous operations with different asynchronous programming models. A edge service is also frequently called an "API gateway". It is a service that serves as a facade to other services, so that a requester has to deal with just one service interface rather than having to talk to each services. It may also perform other tasks such as data transformation and interacting with other services, so it is not just about conveniently aggregating data from multiple services.