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 - Наука та технологія
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!
watching from Japan. Your video is very very helpful. Thank you.
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!
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!
Thank you so much for posting such a helpful video. Informative and explained well.
Keep up the good work!
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
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!!
Definitely subscribing. You condensed days of reading bloated tutorials into a few single videos. Thank you and keep it up!
Great explanation Mitch!!
Thanks Mitch! It helped me a lot!
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.
This was Exception-al. Great video
Hello namesake, thanks for the awesome elaborations
I love you both CodingInFlow and CodingWithMitch :)
Very good video, thanks for that!
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
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
@@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.
Finally understanding coroutine exceptions after floundering for weeks
You explained so nicely 👍
Best video content..
Love your videos man, Please share more videos about testing Hilt and navigation controller, complex scenarios
Very comprehensive
Great Job!
you are the best Mitch :)))
Thank you a lot you are the best.
I am your big fan ...sir Thanks lot :)
You are just amazing 🙏🙏💐💐
Thank you
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.
You`re crazy!!! I love u, bro)
Nice
Hahahaha the part with Florian was golden
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?
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?
no, it's of scope, not parent hierarchy
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.
Hey Mitch,you removed the Corona discount coupon on codingwithmitch's founder subscription ?
❤️❤️❤️
Hello, Mitch.. Could you please do one video about Executing AndroidX tests on JVM?. If so, It will be very helpful.
I think viewModelScope uses SupervisorJob, but why when I use CoroutineExeptionHandler with ViewModelScope it doesn't catch exceptions?
Best
Do we have to use Job's on Android?
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 .
First 😊
what exactly are quarantine cancellation and quarantine exception
Hey, where is the video about SupervisedJob?
please make tutorial on Supervisor JOB
Coming up next
on my mobile phone video quality cannot go beyond 360p ???
This delay funtion seems to be deprecated? Should I throw this movie away?
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
who is that CodingInFlow guy anyways 👀.... lol
😶
cancel() method is deprecated now.
Engage the bendy space engines
You were right that was quite a shitty vlog! Ugh!
Can you make some Android game tutorials using Unity?
Jobs will not be executed simultaneously unless you use Async / Await
try { awesomeCodingWithMitchVideo() } catch { TerribleFontException() }
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
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.
Hi
kotlinx.coroutines.JobCancellationException: UndispatchedCoroutine was cancelled
getting this issue when i change activity(it was observing a stateflow from ViewModel )