The Essence of Coroutines
Вставка
- Опубліковано 7 січ 2025
- In Kotlin and other languages, coroutines are often seen as just async/await. But the essence of coroutines is much simpler and easier to understand. In this video, I'll boil down coroutines to their most fundamental properties.
So glad to have found this via the Kotlin Slack. Your videos are great at explaining and incredibly well produced!
Thanks so much for your kind words, Henning!
Hi Dave, I was trying different books to learn Kotlin... Coming from Java, I wanted something that would give me the essentials of Kotlin... And by accident, I found your book "Kotlin Illustrated Guide".... Wow, in one sitting, I read 6 chapters, and it was just amazing the way it was written and explained.... Thank you so much for your work teaching Kotlin!!
Oh, wow - that's fantastic! I'm so glad to hear that the book has been helpful for you! 🎉 Lots of effort put into it, so it's very rewarding to hear when it resonates well with someone!
I knew!! I will learn something new and your video will not disappoint me. Thanks Dave for the video.
Hey, that's great, Vivek! I'm glad you enjoyed it! 😁
I want to express my gratitude for the clear and concise explanation of coroutines.
Well explained in a unique way that doesn't hide what's happening... kudos!
Thanks so much, Chris!
So helpful, Dave! Thank you for investing so much into helping the Kotlin community thrive!
Thank you, Doug! I'm happy to do so!
this channel is a mine of gold Kotlin ore
Thank you Dave. very clear explanation. more in-depth videos explaining coroutines please.
Thanks, Amir! I'm expecting to get to some more coroutines videos in the new year!
Coroutines
Explanation for coroutines is great!!
Direction Backward > Execution Paused > State Preserved
Amazing explanation! I love your channel, hope you'll keep making more videos
Thank you so much, Katarina! I'll keep at it!
Hey Dave,
This was really great, thanks for making it a fun topic!
Thank you! I'm glad you enjoyed it!
So beautifully explained. Thanks Dave
Your avatar is beautiful.
@@gregandark8571 Thanks. It somewhat depicts the place I live in.
How to use internal low level createCoroutineUnintercepted directly? I always get "Unresolved reference: createCoroutineUnintercepted" error.
I only able to use createCoroutine function to implement this kind of stuff.
Is there any configuartion to let user touch the internal api?
Hello Chao! createCoroutineUnintercepted() is part of the standard library, and you can import it with `import kotlin.coroutines.intrinsics.createCoroutineUnintercepted`. There are two overloads, and they're both public. Keep in mind that they are extension functions on a suspending function, so to invoke one of them, you'll need to call it on a suspending function. To do that, you can either call it on a variable whose type is `suspend () -> T` or `suspend R.() -> T`, or on a suspending lambda directly:
suspend { /* stuff goes here */ }.createCoroutineUnintercepted(Continuation(EmptyCoroutineContext) {})
Hi, I am finding this channel so helpful. Thanks a lot. I would request you to create a video on if coroutines did not exist, how we could achieve concurrency, parallelism in Java / Kotlin. I am particularly stuck in correlating between with and without coroutines.
Thanks so much for the recommendation, Akshay! Are you mostly looking for a comparison between using coroutines and using other approaches - such as futures, promises, etc.?
Hi dave, i just love the way you explain everything like you are teaching a newbie, every time i watch your videos makes my concepts clear, thank you so much, i have 1 request can you please make video series for coroutines, DI type hard to understand concepts in android beginner to advance ???
Can't get tired of your content, how about talking about differences between interfaces, sealed interfaces and sealed classes?
Thanks so much! I'll add that to my list of ideas for future videos!
Dave, what do you do for a living?\
Hi Gaurav! I do software development as an independent contractor, but this year I'm almost exclusively focused on serving the Kotlin community, exploring whether it's possible to make that a sustainable business.
@@typealias It is possible to make a sustainable business. We do not know many more things that you know.😛 So we are the partners in your business
I am learning few years already and still thinking I am dumb
In the software development industry, there's always so much more to learn. That feeling of inadequacy is pretty common, even across different experience levels. Just stay honest about what you know and what you don't know, always be willing to learn more, and stay focused on learning the things that will be the most helpful for you.
This reminds me of the quote "If you can't explain it simply, you don't understand it well enough." - Albert Einstein.
It's like that the whole damn way, that's why understanding each part takes time and builds on the previous... you either like that process and just keep going or you hate it and quit.
Very nice explanation. Thank you
Thanks so much, Guy!
hey Dave! will you be selling physical version of your book? I would love to buy one if you did)
Hey, thanks for asking! Yes, I'm planning to make a print edition available after the digital version is complete. I'll need to finalize Chapter 20, add a few appendices, and rework some images for better print quality - so it might be a few months out yet, but I'm looking forward to it!
@@typealias great news😍. can't wait)
I really like this video. Thank you!
You're most welcome! I'm glad you enjoyed it!
great content!🙌🏻
Please create more videos like this ❤
Great work, awesome video, I always knew how to use coroutines but did not know to explain why they've worked! Thanks for the explanation!
Minor critic here, there's a delay on ur voice with the video that bothers me, hahaha
Hey, thanks so much, Andrei! Wow, ya the audio/video sync on this one is definitely off - that bothers me too! 😅 I've made a few changes to my recording setup and process since this one came out, so hopefully we won't have this problem with the more recent videos!
You have a good deep pleasure voice. Thanks for explaining Coroutines
You're most welcome!
Very well explained. But as a non native-english speaker it's difficult to wrap my head around the meaning of keyword yield in this context
yield as in "give way"
Great video as always! Btw, can you please tell me which IDE theme you use?
Thanks so much! Yes, the main UI Theme is "Dark", and the Editor Color Scheme is "Darcula". I'm pretty sure I made a few small changes to the levels to increase contrast, but the core colors of the editor are from Darcula.
@@typealias thanks!!
Great video, thanks!
Thanks! I'm glad you liked it!
nice 👍
Thank you
This is cool...
Wil you be my mentor.
First.
Second