Launch vs Async in Kotlin Coroutines

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 25

  • @AmitVerma-iq3oe
    @AmitVerma-iq3oe 10 місяців тому +2

    Very informative explanation, short, sweet and simple explanation!

  • @baijusharma6027
    @baijusharma6027 10 місяців тому +2

    Thank you for continuing this series 🙏

  • @deepakkanyan1072
    @deepakkanyan1072 10 місяців тому +2

    Hey Amit, Again very good video: [ Misconception: launch{} return nothing ]. 💯

    • @amitshekhar
      @amitshekhar  10 місяців тому +1

      Glad that you liked it

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

    Content top notch

  • @KunalGoyal
    @KunalGoyal 10 місяців тому +1

    please make a video on types of dispatchers and their use case with withContext

  • @superlucky3999
    @superlucky3999 5 місяців тому +1

    Really helpful thank you

  • @deepakkanyan1072
    @deepakkanyan1072 10 місяців тому

    hey Amit, Can you make a video on best way to Handle NavigationGraph in ComposeUI. thanks
    1. By using routing technique
    2. By using fragment (Old way Navigation graph)
    3. Just using ComposeUI functions.

  • @undeadredemption_
    @undeadredemption_ 10 місяців тому

    I was asked this recently in an interview.

  • @iftak01
    @iftak01 7 місяців тому

    Good video explannation

    • @amitshekhar
      @amitshekhar  7 місяців тому

      Keep learning and keep growing

  • @deepalibhujbal1964
    @deepalibhujbal1964 8 місяців тому

    Can you please make a video on BLE ??

  • @vipinkumar7230
    @vipinkumar7230 9 місяців тому

    I think the exception handling difference that is explained is pretty misleading. async{} does not crash because you are not calling await(). The moment you call await it will crash. async{} does not execute until we call await(). So we cannot say this is a difference. Please correct me if my understanding is wrong here. @amitshekhar

    • @amitshekhar
      @amitshekhar  9 місяців тому +1

      As you mentioned: "async{} does not execute until we call await()". Please experiment regarding this statement and let us know the result.

    • @hoangminhhung25391
      @hoangminhhung25391 9 місяців тому

      Agree with u, launch or aysnc still crash if u not use try/catch exception

    • @mwshubham
      @mwshubham 8 місяців тому

      Looks like my observation was correct async do get executed once task is spawned. And await is only blocking function which wait for the result which can be exception that need to be handled. Will do this experiment to understand this better.

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

      @vipinkumar7230
      1. async{} does not crash because you are not calling await().
      This is correct
      2. async{} does not execute until we call await().
      This is wrong, The coroutine starts running as soon as async is called, but its result is not available until you call await()