The Basics - Kotlin Coroutines

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ค. 2024
  • 🏆 My Online Courses
    ⭐Discount Coupon: LAUNCH-STEVDZA-SAN
    stevdza-san.com
    🐱‍👤 Wanna become a member? Join!
    / @stevdzasan
    📸 Instagram
    / stevdza_san
    A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously. Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages.
    On Android, coroutines help to manage long-running tasks that might otherwise block the main thread and cause your app to become unresponsive. Over 50% of professional developers who use coroutines have reported seeing increased productivity.
    Kotlin, as a language, provides only minimal low-level APIs in its standard library to enable various other libraries to utilize coroutines. Unlike many other languages with similar capabilities, async and await are not keywords in Kotlin and are not even part of its standard library. Moreover, Kotlin's concept of suspending function provides a safer and less error-prone abstraction for asynchronous operations than futures and promises.
    kotlinx.coroutines is a rich library for coroutines developed by JetBrains. It contains a number of high-level coroutine-enabled primitives, including launch, async and others.
    Other videos:
    Scopes - • Coroutine Scopes - Kot...
    Jobs & Cancellation - • Jobs and Cancellation ...
    runBlocking - • runBlocking - Kotlin C...
    withContext - • withContext() - Kotlin...
    🕒Timestamps:
    0:00 - Introduction
    0:22 - Synchronous vs Asynchronous
    2:32 - Dispatchers
    3:06 - Non-Blocking Execution
    3:39 - Suspend Keyword
    4:02 - Practical Examples

ความคิดเห็น • 78

  • @kwesiamartey
    @kwesiamartey 3 ปีที่แล้ว +9

    I love this man, he is concise I want more please

  • @juswes
    @juswes 2 ปีที่แล้ว +4

    I have recently just begun diving into Kotlin and I am quite enjoying myself as it's been a while since I was actively coding. One thing that stood out to me with Kotlin had to be it's Coroutines and after watching this video; I not only feel informed but a lot more spirited and I can't thank you enough. I just might wind up binging on your channel all weekend. Thank you and we definitely need more content.

    • @StevdzaSan
      @StevdzaSan  2 ปีที่แล้ว

      Thank you for your kind words buddy! I'm so happy that you realized how Kotlin programming language is actually amazing to work with. :)

  • @haydarfurkanbiyiklioglu
    @haydarfurkanbiyiklioglu 3 ปีที่แล้ว +42

    We definitely want more. Thanks for teaching for us

    • @misaeljaime9695
      @misaeljaime9695 2 ปีที่แล้ว

      You all prolly dont give a shit but does someone know of a way to get back into an instagram account??
      I was dumb lost my password. I would love any assistance you can give me.

    • @elianchandler7525
      @elianchandler7525 2 ปีที่แล้ว

      @Misael Jaime Instablaster ;)

  • @adityamishra611
    @adityamishra611 3 ปีที่แล้ว +3

    Really liked the way you were explaining. Waiting for more on coroutines.

  • @fethiourghi
    @fethiourghi 3 ปีที่แล้ว +14

    The most understandable explanations I ever seen, thanks

    • @stephentellez5718
      @stephentellez5718 ปีที่แล้ว

      me too
      im going to see again just to be sure that i understood this fully

  • @kos5795
    @kos5795 ปีที่แล้ว +1

    I am from another country in general, but I understand this Teacher better than my teachers in my native language

  • @kateanne419
    @kateanne419 3 ปีที่แล้ว +1

    You made it very easy to understand! Thank you so much!!

  • @nicolasvantsis6166
    @nicolasvantsis6166 3 ปีที่แล้ว +31

    Hi, yes of course we want more. Don't ask stupid questions. 😂😂😂

  • @PetarSrzentic
    @PetarSrzentic 3 ปีที่แล้ว

    Really concise. Definitely more!!!

  • @vaibhavarora8793
    @vaibhavarora8793 2 หลายเดือนก่อน +1

    Thank You , It was very useful.

  • @ariel10aguero
    @ariel10aguero 3 ปีที่แล้ว +1

    Thank you! another great video :)

  • @mamolraptor9942
    @mamolraptor9942 3 ปีที่แล้ว

    Yes we need more. Thanks in advance

  • @idanqwe1
    @idanqwe1 3 ปีที่แล้ว

    Great explanation! Thank you.

  • @amleshkumar9843
    @amleshkumar9843 3 ปีที่แล้ว

    Definitely we want more videos on that. Your all videos are awesome.......Good Luck

  • @abdelrahman3417
    @abdelrahman3417 3 ปีที่แล้ว

    more than perfect > Mach weiter.. gut gemacht!

  • @HariKrishna-mi6is
    @HariKrishna-mi6is ปีที่แล้ว

    Super. Well explained. Please need more.

  • @rolfchristensen9026
    @rolfchristensen9026 ปีที่แล้ว

    This is FIRE! So well explained and very nice code examples . Tahnk you! :)

    • @StevdzaSan
      @StevdzaSan  ปีที่แล้ว

      Glad to help! 🙌

  • @mdevikadarlami2110
    @mdevikadarlami2110 3 ปีที่แล้ว +1

    Yeah, we want more tutorials ... waiting ...Thank you :)

  • @e-kelv1768
    @e-kelv1768 2 ปีที่แล้ว

    everything is much clearer now thanks

    • @StevdzaSan
      @StevdzaSan  2 ปีที่แล้ว

      Glad to hear that buddy!

  • @akash5100
    @akash5100 ปีที่แล้ว

    hi, thread.sleep is required for playground or in any kotlin executor lets say android studio?

  • @wissemmiled3383
    @wissemmiled3383 3 ปีที่แล้ว +1

    we need more , thanks

  • @stefanioan7569
    @stefanioan7569 2 ปีที่แล้ว

    on point! Love it

  • @santoshs490
    @santoshs490 2 ปีที่แล้ว

    Thanks 👍

  • @Aspiret620
    @Aspiret620 3 ปีที่แล้ว

    Love your content and your voice that sounds like a bandit from Stalker.

  • @narimetisaigopi
    @narimetisaigopi 3 ปีที่แล้ว

    Awesome explanation
    We want more videos about coroutines

  • @dibbo-mrinmoysaha406
    @dibbo-mrinmoysaha406 3 ปีที่แล้ว +2

    View model scopes would be very interesting

  • @anudeepananth
    @anudeepananth 3 ปีที่แล้ว +1

    Yes more coroutines videos please....

  • @h.r.60
    @h.r.60 3 ปีที่แล้ว +1

    Keep up the great content! 😁 RxJava tutorial please!

  • @kirakorunov5407
    @kirakorunov5407 2 ปีที่แล้ว

    Thanks bro!!!

  • @stephentellez5718
    @stephentellez5718 ปีที่แล้ว

    what a great video bro, thank you so much for sharing this content

  • @truepicksyt3323
    @truepicksyt3323 3 ปีที่แล้ว +6

    Hello Stevdza, your explanations are perfect, also please try to give us some real-world example of using coroutines, thank you!

    • @StevdzaSan
      @StevdzaSan  3 ปีที่แล้ว +6

      Watch my ROOM Library tutorial series.

  • @Arunxolo
    @Arunxolo 3 ปีที่แล้ว +2

    Thanks ❤️my dear teacher
    Love form india

  • @EyuCoder
    @EyuCoder 3 ปีที่แล้ว +1

    Neat!!!

  • @furkanakcakaya9443
    @furkanakcakaya9443 2 ปีที่แล้ว

    Great video, thanks

    • @StevdzaSan
      @StevdzaSan  2 ปีที่แล้ว

      You're welcome 👌

  • @anujrai5894
    @anujrai5894 3 ปีที่แล้ว +1

    Thanks boss

  • @Alberto_Cavalcante
    @Alberto_Cavalcante 3 ปีที่แล้ว

    Nice!

  • @precious7902
    @precious7902 2 ปีที่แล้ว

    Your contents are really good💯💯, thankss

    • @StevdzaSan
      @StevdzaSan  2 ปีที่แล้ว

      Always happy to help! 🚀

  • @100rabhGrwal
    @100rabhGrwal 3 ปีที่แล้ว +2

    Can also explain about different types of courotine scopes and difference between each of them...like GlobslScope, CourotineScope, ViewModelScope etc.

  • @amiralam1786
    @amiralam1786 3 ปีที่แล้ว

    Please we want more !

  • @ss-xn5rw
    @ss-xn5rw 3 ปีที่แล้ว

    easy explanation

  • @drekstop
    @drekstop 3 ปีที่แล้ว +1

    Hello !
    Thanks for this great tutorial :)
    Maybe that one of you can answer my question about the use of "Thread.sleep" : is there a reason that explain why the main thread doesn't wait for the Coroutine to execute before ending ?
    Is it only due to the fact that we are using it in a simple test on Kotlin Play ? Or is it also necessary to use "Thread.sleep" in a real case, like an app for instance ?
    Thanks a lot !

    • @dujemandalinic5468
      @dujemandalinic5468 ปีที่แล้ว

      Well, if your app lives outside of the terminal, you shouldn't worry about it, because your program will keep running until the user closes the window or exits the app.

  • @andreykalmatskiy2656
    @andreykalmatskiy2656 2 ปีที่แล้ว +1

    this code doesn't work in IDEA

  • @kobiedanquah
    @kobiedanquah 3 ปีที่แล้ว

    thanks for this. Can you also do a tutorial on work Manager

  • @vedx
    @vedx 3 ปีที่แล้ว +2

    🔥🔥👍

  • @chiragpatel6410
    @chiragpatel6410 3 ปีที่แล้ว +1

    Yessss

  • @juarez.roberto
    @juarez.roberto 2 ปีที่แล้ว

    Hi, this playlist is awesome, I was searching this content in spanish but I didn't find anything good.

  • @arctic6281
    @arctic6281 3 ปีที่แล้ว +1

    hi, why when you passed to withContext() Dispatchers.IO name of Thread still is the same, did not change to IO

    • @StevdzaSan
      @StevdzaSan  3 ปีที่แล้ว +4

      Good question. That can often create confusion among developers. Dispatchers.IO is conceptually a "special view" of Dispatchers.Default. They are sharing the same thread pool.
      Check out this answer for more details: stackoverflow.com/questions/59039991/difference-between-usage-of-dispatcher-io-and-default

    • @arctic6281
      @arctic6281 3 ปีที่แล้ว

      @@StevdzaSan thank for answer

  • @silentsometime
    @silentsometime 2 ปีที่แล้ว

    hi, i like your tutorials about kotlin ...can you created a course about airtable or googlesheet database in kotlin .please

  • @jorgeleonardogamarraospino9896
    @jorgeleonardogamarraospino9896 3 ปีที่แล้ว

    we are waiting for the other videos

  • @parveensharma2270
    @parveensharma2270 2 ปีที่แล้ว

    Nice

  • @seanknowles9985
    @seanknowles9985 2 ปีที่แล้ว

    Animations in Jetpack compose bro, we need it!

    • @StevdzaSan
      @StevdzaSan  2 ปีที่แล้ว

      I already have a couple of videos about it, check my channel. ✅️

  • @pavelgera72
    @pavelgera72 ปีที่แล้ว

    больше видео о сопрограммах

  • @parisahazhirghader5539
    @parisahazhirghader5539 3 ปีที่แล้ว

    wont you upload the rest of play list?????

  • @MtaufiqH731
    @MtaufiqH731 3 ปีที่แล้ว +1

    First!!!

  • @anikchowdhurybd
    @anikchowdhurybd 3 ปีที่แล้ว

    Second viewer 😁😁

  • @mainactivityKt
    @mainactivityKt 11 หลายเดือนก่อน

    This accent is really weird lol. Especially when he prounces the "h" and "o" sounds.

  • @prosto9028
    @prosto9028 2 ปีที่แล้ว

    нет, не поставлю