Programming Throwdown cover image

144: Kotlin Coroutines with Marcin Moskala

Programming Throwdown

CHAPTER

How to Use the Sealed Function With No Arguments to Block Threats

Coroutines can only switch at the suspension points. So if those coroutines never suspend what is very unlikely because we generally use coroutines to do things that are suspending. However, even in such extremely rare situations there are good practices like using the sealed function with no arguments. If you have things that are blocking there is a dispatcher IO to be blocked. And on Android the most popular is this patch is main that is a pool of threats that only has one threat that is the main threat - and it's perfectly fine for simple applications.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner