Kotlin Coroutines: Beyond async/await
Sensei at Big Nerd Ranch
Kotlin coroutines support the familiar async/await style, as well as channel and goroutine styles. Learning from the predecessors, designers of the language managed to accomplish this with only one reserved keyword: suspend. Coroutines were invented at the dawn of programming languages, but were quickly forgotten when threads and other fashionable techniques were popularized. They are making a major comeback as many mainstream languages have introduced support for coroutines and similar mechanisms: async/await, channels, goroutines. Kotlin language designers figured out a way to emulate many of those patterns by pushing the details to the library functions and reserving only one keyword: suspend.