5 Beyond callbacks
This chapter covers
- Callbacks and their limitations, as shown with a gateway/edge service example
- Futures and promises--a simple model to chain asynchronous operations
- Reactive extensions--a more powerful model that is especially well suited to composing streams of asynchronous events
- Kotlin coroutines--language-level support for asynchronous code execution flows
You will need to write all sorts of business logic while developing a reactive application, and not all logic is easy to express in an asynchronous form. While callbacks are a simple form of asynchronous event notification, they can easily render asynchronous code complicated.
Let’s look at a real example of why callbacks are not always the best asynchronous programming ...
Get Vert.x in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.