Coroutines: Concurrency in Kotlin

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 71

  • @tonyseben
    @tonyseben Месяц назад +31

    Hands down the best explanation on Coroutines on the internet! The analogies and the illustrations are on point.

    • @typealias
      @typealias  Месяц назад +4

      Wow, thanks so much, Tony! I'm glad you liked it!

  • @sureshsivalingam01
    @sureshsivalingam01 Месяц назад +15

    I think you're the best underrated youtuber on android development videos

    • @typealias
      @typealias  Месяц назад +2

      Hey, thanks so much, Suresh - I appreciate that!

  • @milleniumtv908
    @milleniumtv908 Месяц назад +16

    Hi, I love how u make describe things, very concise and understandable. Please keep posting more. Love u

    • @typealias
      @typealias  Месяц назад +4

      Hey, thanks so much! Glad you enjoy it.

    • @doboshmichael
      @doboshmichael Месяц назад +3

      Absolutely! It's definitely an underestimated skill - being able to describe things in simple words

  • @StefanoGroenland
    @StefanoGroenland 3 дня назад +1

    You’re awesome 🎉 I haven’t learned a new language this fast, ever before! You sir are great at explaining! Keep this up!!

    • @typealias
      @typealias  2 дня назад +1

      Oh wow, that's really great to hear - really glad that you're picking it up so quickly! I'll keep at it!

  • @nixoncode
    @nixoncode Месяц назад +8

    Really beautifully explained concurrency concepts

    • @typealias
      @typealias  Месяц назад +2

      Thank you so much, Nixon!

  • @mithileshdhupia2533
    @mithileshdhupia2533 Месяц назад +10

    Best video i ever watched on coroutine

    • @typealias
      @typealias  Месяц назад +2

      Wow, that's kind of you to say that! Thank you so much!

  • @JaganathanG
    @JaganathanG Месяц назад +2

    Your explanations, illustrations, and key points are all put together so well; it’s a beautifully orchestrated presentation. I wish you had been my college tutor.

    • @typealias
      @typealias  Месяц назад +1

      Wow, thank you so much! I'm so glad you liked it!

  • @electrick5182
    @electrick5182 Месяц назад +2

    Thank you for sharing this kind of video! The story telling and the overall presentation makes it easy to understand these concepts. Keep it up mate! So glad your video appeared on my Home page :)

    • @typealias
      @typealias  Месяц назад +3

      Hey, that's great - I'm so glad you found this style of presentation effective! I'll definitely keep it up! 👍

  • @phucosg
    @phucosg Месяц назад +3

    I would love to see a tutorial on how you created those lovely picture for the demonstration. Your website has always been my recommendation for new joiner of our team to get started with Kotlin.

    • @typealias
      @typealias  Месяц назад +2

      Thanks so much! I'd be happy to demonstrate the drawing process - I'll add that to my list of "bonus video" ideas

  • @nehaljain8193
    @nehaljain8193 Месяц назад +3

    You make every concept to understand so easily, Thanks a lot :) Keep posting :)

    • @typealias
      @typealias  Месяц назад +2

      Thank you, Nehal! I'll keep at it!

  • @fabricioaraujo7642
    @fabricioaraujo7642 Месяц назад +1

    This channel are slowly became the best content about kotlin stuff in yt ! Congrats

    • @typealias
      @typealias  Месяц назад +1

      Wow, thank you so much, Fabricio! I appreciate it!

  • @abdushakoor0099
    @abdushakoor0099 Месяц назад +4

    2 minutes in the video already love it

  • @filipbeban
    @filipbeban Месяц назад +3

    Great job, Dave, as always!

  • @thetechiegarage
    @thetechiegarage 6 дней назад

    This is such a great breakdown on coroutines! Thank you!

  • @EmmanuelBLONVIA
    @EmmanuelBLONVIA 8 дней назад

    Dave, I've watched several videos of yours and I can tell that you are definitely the BEST Kotlin teacher on the planet. I'll buy your book.
    If you have a paid Kotlin and/or KMP course, I will also buy it !

    • @typealias
      @typealias  8 дней назад +1

      Hey, thank you so much, Emmanuel - that's very kind of you to say! I haven't got any online courses just yet, but I'm planning to start working on them after I put the finishing touches on the book.

  • @mahmoudrizk15
    @mahmoudrizk15 27 дней назад

    Thank You sir.
    You are the best Kotlin content creator on RUclips NO QUESTION ASKED, they should hand you the diamond play button now❤❤❤❤

    • @typealias
      @typealias  27 дней назад

      Haha, wow! That's very kind of you to say that 😁 Thank you so much!

  • @Adyel-YT
    @Adyel-YT 23 дня назад

    The visualizations really helped. Thanks for the great informative video.

  • @thisissmz
    @thisissmz Месяц назад +1

    Great presentation. Thanks for sharing the information. ❤

    • @typealias
      @typealias  Месяц назад +1

      You're most welcome!

  • @ArthurKhazbs
    @ArthurKhazbs Месяц назад

    Woah! Turns out coroutines are not running on magic! Dave, thank you so much for the great explanation, the captivating story and the wonderful illustrations! Top shelf video, as always on your channel! :)

    • @typealias
      @typealias  Месяц назад

      I appreciate that, Arthur! Thanks so much! 😁

  • @CommanderSteps
    @CommanderSteps Месяц назад +2

    Great video, thank you! :)

  • @enossalar8837
    @enossalar8837 Месяц назад +2

    Such a great explanation

  • @cdhiraj40
    @cdhiraj40 Месяц назад +2

    great explanation! thanks for this.

    • @typealias
      @typealias  Месяц назад +2

      Thanks, Dhiraj! And you're most welcome!

  • @guyguy467
    @guyguy467 Месяц назад +2

    Great explanation

  • @ivanpagac7946
    @ivanpagac7946 29 дней назад

    best tutor ever!!!! clear, to the point

    • @typealias
      @typealias  27 дней назад

      Thanks so much, Ivan!

  • @flowzk921
    @flowzk921 Месяц назад

    Super Super Awesome! very great story telling!

  • @ericwathome783
    @ericwathome783 Месяц назад

    You should do more chapters of the book like this. This is very helpful

  • @loveyouself5389
    @loveyouself5389 23 дня назад

    Wow! Please do more✨

  • @devopsthinh
    @devopsthinh Месяц назад +2

    Great talk, thanks, from Vietnam😅😅😅

    • @typealias
      @typealias  Месяц назад +1

      Hey, thanks so much! And hello! 🙂

  • @user-pt6kg8qj4j
    @user-pt6kg8qj4j Месяц назад +2

    Highly Recommended #trending

  • @MuhammadDaif
    @MuhammadDaif 7 дней назад

    This is art ! :-)

  • @haukekonradcoding
    @haukekonradcoding Месяц назад +1

    Great explanations. Where are your cool cartoons from, did you create them yourself?

    • @typealias
      @typealias  Месяц назад +2

      Thanks so much - I'm glad you like the cartoons! Yes, I created all the illustrations in this video. Cartooning has always been a hobby of mine, so it's fun getting to combine my drawing and programming interests into my videos and articles. 😁

  • @user-zf6fi3th5t
    @user-zf6fi3th5t Месяц назад +1

    Добрый день. Все кирпичики становятся на свои места )) Кажется вам очень нравится Котлин?

    • @typealias
      @typealias  Месяц назад +1

      That's great! Yes, I've been very happy with Kotlin!

  • @archit7606
    @archit7606 Месяц назад +2

    You have any courses and/or books on Kotlin and Kotlin Multi-platform?

    • @typealias
      @typealias  Месяц назад +2

      Hey Archit, thanks for asking! The main content of my book is complete, and I'm working on upscaling the illustrations so that we can get a good print edition of it. You can read it online (typealias.com/start) and there's a Leanpub edition for purchase if you prefer PDF (book.typealias.com). I don't have any courses available yet, but I'm planning to focus on creating them after the print edition of the book is ready.

    • @archit7606
      @archit7606 Месяц назад

      @@typealias Nice! It would be great if you make a complete series titled "Kotlin Multi-platform for Java Developers"! ❤️

  • @PedroBarbosaRoman
    @PedroBarbosaRoman 29 дней назад

    Thank you for the great presentation! I have question related to the first coroutine example: shouldn't the second coroutine have a yield() as the first line of the block, since the order of the coroutines is not guaranteed and so the Hammer clothesline could run before the Sledge suplex? With the first yield we ensure that the first line of code of the first launched coroutine will always run first. Does it make sense?

    • @typealias
      @typealias  27 дней назад

      Hey, thanks so much, Pedro! I believe that isn't necessary here because we're just using runBlocking's event loop as the dispatcher, which - at least in practice - processes them first-in-first-out. If we add yield() at the beginning of that second launch, we'll see two moves from Sledge before Hammer does anything. Let me know if you do get different output than that, though!

    • @PedroBarbosaRoman
      @PedroBarbosaRoman 27 дней назад

      ​@@typealias Yes, you are correct! It seems that the runBlocking runs the first coroutine until it finds a yield() or some other function that also yields like a delay() or the coroutine ends, before even running the second one. I tried using a while loop that does nothing in the first coroutine without yielding and the second coroutine wasn't even started which indicates the behaviour you described! Also tested runBlocking with a Dispatchers.Default and the behaviour changed so this is due to the event loop runBlocking uses. Thanks for the clarification!

    • @typealias
      @typealias  25 дней назад +1

      Okay, fantastic - thanks for taking the time to confirm that, Pedro! And of course, in most real-life scenarios, I'm sure it's a good idea to keep in mind that the order isn't guaranteed, as you mentioned. 👍

  • @Charles-EddyPARPET
    @Charles-EddyPARPET Месяц назад

    Hello, I'm wondering if you are okay that I use your illustrations and explanations for a Kotlin training I'm giving in my company? (Of course I'll source the illustrations linking to your typealias website)

    • @Charles-EddyPARPET
      @Charles-EddyPARPET Месяц назад

      By the way, that was really cool explanations of the concept of coroutines. :-)

    • @typealias
      @typealias  Месяц назад

      Hey Charles, thanks for asking! Would you be able to send me a direct message on X (x.com/djleeds), LinkedIn (www.linkedin.com/in/daveleeds/), or Kotlin Slack (djleeds)? Happy to follow up with you there!

  • @shahidzbi
    @shahidzbi Месяц назад +2

    Head Down Sir what's an Explanation
    Guys let's make that Skyscraper by hitting the Subscribe Button ❤

    • @typealias
      @typealias  Месяц назад +2

      Haha, thanks so much Shahid! I appreciate that! 😁

    • @shahidzbi
      @shahidzbi Месяц назад +1

      ❤🎉

  • @Chriptus
    @Chriptus Месяц назад

    Instead of runblocking at entrypoint of the application we should declare main as suspend

    • @typealias
      @typealias  Месяц назад +2

      We can do that, but then we won't have a coroutine scope upon which to call launch(). So we'd have to wrap the launch() calls in a `coroutineScope {}` block. In other words, we'd end up replacing `runBlocking {}` with both a `suspend` modifier and a `coroutineScope {}`.
      For this video, that would have been a lot of concepts to introduce just to run our first coroutine, so I stuck with runBlocking. But yes, you can certainly add the suspend modifier to main() if you'd like!

    • @Chriptus
      @Chriptus Месяц назад

      @@typealias ya that makes sense for educative purposes to keep few concepts at a time!

  • @robchr
    @robchr Месяц назад +1

    You have a typo where it should be `.also { it.cancel() }`

    • @typealias
      @typealias  Месяц назад +1

      Ah, you're right - thanks for catching that! Wish I could update the video with a fix, but RUclips doesn't let you change much. So hopefully anyone who gets stuck on it will notice your comment. 😅 I'll see if I can add an info card or something...