To write asynchronous code in both Java and Kotlin, there are a number of different primitives, libraries, and patterns at our disposal. Choosing the correct way to model async code for your project will depend on your specific needs, but understanding which options are available can improve the selection process. In this section, we will examine a number of primitives and patterns for writing asynchronous code across both Kotlin and Java.
Understanding async patterns
Threading primitives
Kotlin and Java share a number of lower-level primitives for writing async code. These primitives can be used for simple, one-off operations, or can be combined with more complex systems so that you can manage asynchronous code in your project...