5 Common Traps You Can Step Into When Using Coroutines

Philipp Lackner
Native Android YouTuber

5 Common Traps You Can Step Into When Using Coroutines

Philipp Lackner
Native Android YouTu ...

5 Common Traps You Can Step Into When Using Coroutines

Philipp Lackner
Native Android YouTuber

Video Infos
Author
Published
Topics
Author
Published
1. Talk description Coroutines are a brilliant way to apply async programming in Kotlin projects, since they help us to avoid callback hell. On the surface, they seem to be very easy to use, however there are many not so obvious traps, you can step into if you're new to them. This presentation will cover 5 of the most common and biggest mistakes you can make when using coroutines. 2. Key takeaways 1. Using async to avoid executing suspending calls sequentially 2. Coroutines aren't cancellable by default - you have to set them up for that 3. Build your suspend functions around the concept of main-safety 4. Catching general exceptions in coroutines can mess up that cancellation is properly propagated 5. Exposing suspend functions in a ViewModel to the UI is not what you should do - the lifecycle will get in your way 3. My experience level with this topic I've been using Kotlin for 3 years on a day-to-day basis. In that time, I've mostly used coroutines and Flows for async programming which helped me to understand the subject well, since I've had a lot of time to make mistakes and learn from them. 4. Have I given this talk before? Not as a talk, but as a YouTube video which was extremely well received: https://www.youtube.com/watch?v=cr5xLjPC4-0 Having made this video, I can also benefit a lot from the feedback I got there to make the talk even better. 5. Some additional keywords coroutines, async programming

LATEST ANDROID JOBS

update your work life

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu