Kotlin: Simplifying APIs with coroutines – MAD Skills

j

by Kivi

}

06.29.2022



If you’re a library author, you might want to make your Java-based or callback-based libraries easier to consume from Kotlin using coroutines and Flow. Alternatively, if you’re an API consumer, you may be willing to adapt a 3rd party API surface to coroutines to make them more Kotlin friendly.

This video covers how to simplify APIs using coroutines and Flow as well as how to build your own adapter using suspendCancellableCoroutine and callbackFlow APIs. For the most curious ones, those APIs will be dissected and you’ll see how they work under the hood.

Building a Kotlin extensions library → http://goo.gle/2WyYR6t
Coroutines & Patterns for work that shouldn’t be cancelled → http://goo.gle/3nqc1yj
The suspend modifier — under the hood → http://goo.gle/2Wo41BT

Catch more Kotlin and Jetpack APIs for MAD Skills → https://goo.gle/kotlin-madskills

Watch more MAD Skills episodes → http://goo.gle/madskills
Subscribe to Android Developers → https://goo.gle/AndroidDevs

#Kotlin #Jetpack #MADSkills

source

Kiviac.com is reader-supported. When you buy through links on our site, we may earn an affiliate commission.

Featured Articles

FOLLOW US

Comments

0 Comments

Related Posts

Take a Hike | Smugglers’ Notch Resort Vermont

Take a Hike | Smugglers’ Notch Resort Vermont

This weekend is shaping up to offer weather hikers love: comfortable temperatures, no serious heat to battle, and dry conditions that make getting out on the trail ideal. Before we start throwing around words like easy, moderate, and hard, though, let’s get one...

Mercedes-Benz Future Truck 2025 | Shaping Future Transportation

Mercedes-Benz Future Truck 2025 | Shaping Future Transportation

Effeciency. Safety. Connectivity. From a vision to reality -- the Mercedes-Benz Future Truck 2025 gives an exciting and realistic outlook on the long-distance truck of tomorrow. In ten years trucks will be able to drive autonomously on the motorways and highways of...