Coroutine Structured Concurrency, Error Handling and Exceptions

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • The best Android courses in the world: codingwithmitch.com/
    In this video I talk about structured concurrency with Kotlin coroutines, how exceptions are handled with Kotlin coroutines, and how cancelations are handled in Kotlin coroutines.
    Code: github.com/mitchtabian/Kotlin...
    Instagram: / codingwithmitch
    Twitter: / mitch_tabian
    .
    .
    #codingwithmitch
  • Наука та технологія

КОМЕНТАРІ • 66

  • @MMB3245
    @MMB3245 2 роки тому +3

    I'm surprised that your channel has fewer subscribers than Coding in Flow. I always find your videos to be much more concise, and easier to follow and understand. You now have 128k subscribers so congrats to you Mitch and thanks as always!

  • @hmasaya6409
    @hmasaya6409 2 роки тому

    watching from Japan. Your video is very very helpful. Thank you.

  • @Diemermakes
    @Diemermakes 4 роки тому

    These videos are so timely. I started to go look for documentation for exactly this topic, and decided to check your channel first. Glad I did!

  • @cosovic14
    @cosovic14 4 роки тому +5

    You just earned a new sub my friend, thank you!
    I've been studying Android Dev for about a few months now and my mentor just introduced me to Coroutines and I'm trying to take it all in. This is a very helpful breakdown, appreciate it once again!

  • @niteshgoyal6523
    @niteshgoyal6523 Рік тому

    Thank you so much for posting such a helpful video. Informative and explained well.
    Keep up the good work!

  • @mohammadjahangiry2371
    @mohammadjahangiry2371 4 роки тому

    hey Mitch you're the best Android Teacher I've ever had. You've helped me a lot to be professional at Android Programming. thank you so much. cheers to Mitch Tabian

  • @xeckuc
    @xeckuc 4 роки тому

    I like your videos, especially now that i started working with coroutines and after seeing your tutorials i need to change some of my code (lucky that im in the early stages), keep this up!!

  • @x32gx
    @x32gx 3 роки тому

    Definitely subscribing. You condensed days of reading bloated tutorials into a few single videos. Thank you and keep it up!

  • @avillagomez1981
    @avillagomez1981 2 роки тому

    Great explanation Mitch!!

  • @markstoica2405
    @markstoica2405 4 роки тому +1

    Thanks Mitch! It helped me a lot!

  • @davidespano8674
    @davidespano8674 2 роки тому

    I think you underestimate the value of your content do not fret over what other channels do. Your way of explaining isolated subjects through simple examples is extremely helpful and clear and someone looking to learn Android wil eventually bump into your channel and use it to learn their rope. Thanks.

  • @jedikv
    @jedikv 3 роки тому

    This was Exception-al. Great video

  • @mitch8204
    @mitch8204 4 роки тому +1

    Hello namesake, thanks for the awesome elaborations

  • @shruti571
    @shruti571 3 роки тому

    I love you both CodingInFlow and CodingWithMitch :)

  • @radzikjasiek
    @radzikjasiek 2 роки тому

    Very good video, thanks for that!

  • @goobar
    @goobar 4 роки тому +3

    Really nice breakdown of these examples 👍 Gave me a different perspective to think about.
    I haven't found myself typically concerned with the Jobs or in responding to the error or completion of all coroutines within a Job. I've always tended to focus on individual coroutines; handling exceptions on a case by base basis and using mechanisms like await() if I need to wait for everything before continuing execution.
    I can potential use cases though for installing exception handlers or completion responses at the job level though as well

    • @codingwithmitch
      @codingwithmitch  4 роки тому +1

      Ya it wasn't clear to me until going through these types of examples. The parent is affected in various ways depending on what happens

    • @goobar
      @goobar 4 роки тому +1

      @@codingwithmitch Yeah. I think I've never given too much thought to controlling/configuring the parent because I'm so often using the Jobs provided for Activity/Fragment & ViewModel. So I usually just have a couple of places where coroutines are aggregated/collected and just try to handle the exceptions for those locations.
      When I was at Udacity we were trying to implement offline support and had to download sometimes hundreds of small files at a time and then report back on the status of individual items as well as the group. In that case, I can see how having a Job setup for those specific tasks and the completion & error management, could be useful.

  • @ChrisAthanas
    @ChrisAthanas 3 роки тому

    Finally understanding coroutine exceptions after floundering for weeks

  • @bhuvneshvarma7843
    @bhuvneshvarma7843 3 роки тому

    You explained so nicely 👍

  • @swingtrade9270
    @swingtrade9270 4 роки тому +1

    Best video content..

  • @mortitotti
    @mortitotti 3 роки тому

    Love your videos man, Please share more videos about testing Hilt and navigation controller, complex scenarios

  • @chrisfelix9065
    @chrisfelix9065 3 роки тому

    Very comprehensive

  • @DouglasQueirozLima
    @DouglasQueirozLima 3 роки тому

    Great Job!

  • @salamomran1507
    @salamomran1507 4 роки тому

    you are the best Mitch :)))

  • @baselmarwan1334
    @baselmarwan1334 4 роки тому

    Thank you a lot you are the best.

  • @sunilsarode152
    @sunilsarode152 4 роки тому

    I am your big fan ...sir Thanks lot :)

  • @pankajkumargt
    @pankajkumargt 3 роки тому

    You are just amazing 🙏🙏💐💐

  • @user-sg4kw8uh3m
    @user-sg4kw8uh3m Рік тому

    Thank you

  • @jonaskahn5048
    @jonaskahn5048 4 роки тому

    It would really be more helpful if you continue on making the videos based on exploring Kotlin STL and some of its core features like inline, apply, launch, get() etc.

  • @KIRILLINGUSS21
    @KIRILLINGUSS21 3 роки тому

    You`re crazy!!! I love u, bro)

  • @raghababa1250
    @raghababa1250 Рік тому

    Nice

  • @GakisStylianos
    @GakisStylianos 4 роки тому +2

    Hahahaha the part with Florian was golden

  • @NimaAzh
    @NimaAzh 4 роки тому

    Hey, Thank you for your sharing knowledge .
    Please answer my question. At the end of the video you talked about supervisor Job. For the scenario that we want to continue running rest of the jobs and parent job. OK . but at the begin-middle of the video you talked and programmed about cancel() method or throw CancellationException.
    Are they similar to supervisor Job? if they are. So why do you talk about them ( cancel() method or throw CancellationException) ? I guess you follow cleanest way to do that, right?

  • @hnim2292
    @hnim2292 4 роки тому +1

    Never missed a video in this coroutine series. Thanks Mitch!
    I have a question, in some videos you use something like
    val job = Job()
    jobA = CoroutineScope.launch(IO + job){ //....}
    so that you can cancel all other jobs that use the same job. Is this telling job is the parent job of jobA? And all the purpose of this is manage other jobs, like we can cancel it?

    • @Punarjagran
      @Punarjagran 2 роки тому

      no, it's of scope, not parent hierarchy

  • @Alchemist10241
    @Alchemist10241 Рік тому

    16:20 So that's the job of Supervisor Job, I was using it in my projects for eons but I had no idea what it does.

  • @bjugdbjk
    @bjugdbjk 3 роки тому

    Hey Mitch,you removed the Corona discount coupon on codingwithmitch's founder subscription ?

  • @foreverrafs
    @foreverrafs 4 роки тому +1

    ❤️❤️❤️

  • @arunkumarka1809
    @arunkumarka1809 3 роки тому

    Hello, Mitch.. Could you please do one video about Executing AndroidX tests on JVM?. If so, It will be very helpful.

  • @anesabismail6111
    @anesabismail6111 4 роки тому +1

    I think viewModelScope uses SupervisorJob, but why when I use CoroutineExeptionHandler with ViewModelScope it doesn't catch exceptions?

  • @sherazali6324
    @sherazali6324 4 роки тому

    Best

  • @igorg.8624
    @igorg.8624 4 роки тому

    Do we have to use Job's on Android?

  • @codingCouncil
    @codingCouncil 3 роки тому

    Hey mich ,
    Cancellation within he launch WOULD cancel that specific job , but wont do anything to the parent Job .
    Isn't that the case? .. I was testing it myself .. and as soon as I called cancel() inside launch of a scope , i started getting isActive as false .

  • @kamothesci03siddhantmandap95
    @kamothesci03siddhantmandap95 4 роки тому +1

    First 😊

  • @HienNguyen-xn7tr
    @HienNguyen-xn7tr 4 роки тому

    what exactly are quarantine cancellation and quarantine exception

  • @MrNekitfr
    @MrNekitfr 4 роки тому

    Hey, where is the video about SupervisedJob?

  • @charuwaka1
    @charuwaka1 4 роки тому +1

    please make tutorial on Supervisor JOB

  • @yt-1161
    @yt-1161 2 місяці тому

    on my mobile phone video quality cannot go beyond 360p ???

  • @dasstraat
    @dasstraat 3 роки тому

    This delay funtion seems to be deprecated? Should I throw this movie away?

  • @vimalv6341
    @vimalv6341 3 роки тому

    Mitch I think you are wrong in 2 scenario when 2nd job will use cancel(CancellarionException("Error result for number: ${number}"))
    It will show the Exception as JobcancellationException and you said it will do nothing.. check once

  • @goobar
    @goobar 4 роки тому +12

    who is that CodingInFlow guy anyways 👀.... lol

  • @danilochagov8418
    @danilochagov8418 3 роки тому

    cancel() method is deprecated now.

  • @ChrisAthanas
    @ChrisAthanas 3 роки тому

    Engage the bendy space engines

  • @NJTROJAN
    @NJTROJAN 4 роки тому

    You were right that was quite a shitty vlog! Ugh!

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 4 роки тому

    Can you make some Android game tutorials using Unity?

  • @igorg.8624
    @igorg.8624 4 роки тому

    Jobs will not be executed simultaneously unless you use Async / Await

  • @kgandkg
    @kgandkg 4 роки тому

    try { awesomeCodingWithMitchVideo() } catch { TerribleFontException() }

  • @theyoutuber273
    @theyoutuber273 2 роки тому

    Coroutines ere the most stupid concept for asynchronous programming in any language I have learned. Exception handling have too many "exceptions" around it. It's like it was designed by a middle schooler

  • @technics6215
    @technics6215 Рік тому

    Mitch, I think your channel has worse "rank" on UA-cam, because that other channel you mentioned has few videos about very very basic stuff, where the best is "How to Make a Button Open a New Activity" that has 1M+ views. Your video with most views has at this moment 369K and is about... MVVM. Thats a lot if you consider that level of content. Higher level of content means less audience, because there are like 10x less programmers who actually may be interested in MVVM, than beginners who need to know how to open an activity.

  • @mdjahidulislam9205
    @mdjahidulislam9205 Рік тому

    Hi
    kotlinx.coroutines.JobCancellationException: UndispatchedCoroutine was cancelled
    getting this issue when i change activity(it was observing a stateflow from ViewModel )