Kotlin Coroutines Tutorial (STABLE VERSION) - async / await, withContext, launch

Опубликовано: 30 Сентябрь 2024
на канале: Reso Coder
78,141
2.4k

📗 Get the code from this tutorial 👇👇
https://resocoder.com/kotlin-coroutin...

Maven repository for kotlinx-coroutines-core: https://mvnrepository.com/artifact/or...

Start saving time now by planning weekly with Week Sweep: http://bit.ly/2Jf3QA0

With Kotlin 1.3 we finally have a stable library for coroutines. This means that there won't be any breaking changes to the API. Now is an especially good time to learn how to use them.

Coroutines are basically light-weight, much more efficient threads. As a bonus, they are extremely easy to work with once you know the basics. Asynchronous coroutine code looks the same as a classic synchronous code. You don't need to learn any new programming paradigms in order to use Kotlin's coroutines.

In this tutorial you are going to learn quite a bit about coroutines - different ways of launching them, blocking versus non-blocking code and async / await.

Go to my website for more information, code examples and articles:
● http://resocoder.com

Follow me on social media:
●   / resocoder  
●   / resocoder