The Essence of Coroutines

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • 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.
  • Наука та технологія

КОМЕНТАРІ • 56

  • @henninghoefer
    @henninghoefer 4 місяці тому +19

    So glad to have found this via the Kotlin Slack. Your videos are great at explaining and incredibly well produced!

    • @typealias
      @typealias  4 місяці тому

      Thanks so much for your kind words, Henning!

  • @gabrielm6849
    @gabrielm6849 2 місяці тому +1

    this channel is a mine of gold Kotlin ore

  • @ChrisAthanas
    @ChrisAthanas 4 місяці тому +4

    Well explained in a unique way that doesn't hide what's happening... kudos!

    • @typealias
      @typealias  4 місяці тому

      Thanks so much, Chris!

  • @prasantkumar7693
    @prasantkumar7693 3 місяці тому +1

    I want to express my gratitude for the clear and concise explanation of coroutines.

  • @LifeLessonsLearned8587
    @LifeLessonsLearned8587 4 місяці тому +4

    I knew!! I will learn something new and your video will not disappoint me. Thanks Dave for the video.

    • @typealias
      @typealias  4 місяці тому

      Hey, that's great, Vivek! I'm glad you enjoyed it! 😁

  • @vengateshm2122
    @vengateshm2122 4 місяці тому +1

    Coroutines
    Explanation for coroutines is great!!
    Direction Backward > Execution Paused > State Preserved

  • @akshayprabhu4601
    @akshayprabhu4601 8 днів тому

    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.

    • @typealias
      @typealias  4 дні тому

      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.?

  • @katarinazivkovic3102
    @katarinazivkovic3102 4 місяці тому +2

    Amazing explanation! I love your channel, hope you'll keep making more videos

    • @typealias
      @typealias  4 місяці тому +1

      Thank you so much, Katarina! I'll keep at it!

  • @Doruko666
    @Doruko666 4 місяці тому +1

    Can't get tired of your content, how about talking about differences between interfaces, sealed interfaces and sealed classes?

    • @typealias
      @typealias  4 місяці тому

      Thanks so much! I'll add that to my list of ideas for future videos!

  • @thatdougsmith
    @thatdougsmith 3 місяці тому

    So helpful, Dave! Thank you for investing so much into helping the Kotlin community thrive!

    • @typealias
      @typealias  3 місяці тому

      Thank you, Doug! I'm happy to do so!

  • @Arkit21
    @Arkit21 2 місяці тому

    Hey Dave,
    This was really great, thanks for making it a fun topic!

    • @typealias
      @typealias  2 місяці тому

      Thank you! I'm glad you enjoyed it!

  • @gb_kash
    @gb_kash 3 місяці тому +1

    So beautifully explained. Thanks Dave

    • @gregandark8571
      @gregandark8571 27 днів тому +1

      Your avatar is beautiful.

    • @gb_kash
      @gb_kash 27 днів тому

      @@gregandark8571 Thanks. It somewhat depicts the place I live in.

  • @L4szcZ
    @L4szcZ 4 місяці тому +9

    I am learning few years already and still thinking I am dumb

    • @typealias
      @typealias  4 місяці тому +13

      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.

    • @LifeLessonsLearned8587
      @LifeLessonsLearned8587 4 місяці тому +1

      This reminds me of the quote "If you can't explain it simply, you don't understand it well enough." - Albert Einstein.

    • @ChrisAthanas
      @ChrisAthanas 4 місяці тому +1

      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.

  • @andreifigueiredo1737
    @andreifigueiredo1737 День тому

    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

    • @typealias
      @typealias  День тому

      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!

  • @boschpharma7147
    @boschpharma7147 4 місяці тому

    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 ???

  • @guyguy467
    @guyguy467 4 місяці тому +2

    Very nice explanation. Thank you

    • @typealias
      @typealias  4 місяці тому +1

      Thanks so much, Guy!

  • @BLIHOK
    @BLIHOK 4 місяці тому +1

    I really like this video. Thank you!

    • @typealias
      @typealias  4 місяці тому

      You're most welcome! I'm glad you enjoyed it!

  • @gamarmustafa
    @gamarmustafa 4 місяці тому +3

    great content!🙌🏻

  • @ZiranVizard
    @ZiranVizard 3 місяці тому

    You have a good deep pleasure voice. Thanks for explaining Coroutines

    • @typealias
      @typealias  3 місяці тому

      You're most welcome!

  • @starry_shivam
    @starry_shivam 4 місяці тому

    Great video as always! Btw, can you please tell me which IDE theme you use?

    • @typealias
      @typealias  4 місяці тому +1

      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.

    • @starry_shivam
      @starry_shivam 4 місяці тому

      @@typealias thanks!!

  • @AshuTK
    @AshuTK 4 місяці тому

    Please create more videos like this ❤

  • @gamarmustafa
    @gamarmustafa 4 місяці тому +1

    hey Dave! will you be selling physical version of your book? I would love to buy one if you did)

    • @typealias
      @typealias  4 місяці тому +3

      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!

    • @gamarmustafa
      @gamarmustafa 4 місяці тому

      @@typealias great news😍. can't wait)

  • @gauravthakkar802
    @gauravthakkar802 4 місяці тому +2

    Dave, what do you do for a living?\

    • @typealias
      @typealias  4 місяці тому +4

      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.

    • @akshayprabhu4601
      @akshayprabhu4601 8 днів тому

      @@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

  • @khouari1
    @khouari1 4 місяці тому

    Great video, thanks!

    • @typealias
      @typealias  4 місяці тому

      Thanks! I'm glad you liked it!

  • @cppgohan
    @cppgohan 2 місяці тому

    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?

    • @typealias
      @typealias  2 місяці тому +1

      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) {})

  • @henrik908
    @henrik908 4 місяці тому

    Thank you

  • @shrinivasmanjithaya2112
    @shrinivasmanjithaya2112 4 місяці тому

    This is cool...

  • @xpynim
    @xpynim 4 місяці тому

    nice 👍

  • @Happymaninyellow
    @Happymaninyellow Місяць тому

    Wil you be my mentor.

  • @dusilva3796
    @dusilva3796 4 місяці тому +1

    First.

  • @dodalovic
    @dodalovic 4 місяці тому

    Second