reactormonk
04/02/2024, 9:34 AMwithContext(<http://Dispatchers.IO|Dispatchers.IO>) { }
? ViewModel?SanjayKarki
04/02/2024, 9:41 AMRobert Williams
04/02/2024, 10:20 AMRobert Williams
04/02/2024, 10:21 AMMichael Krussel
04/02/2024, 1:34 PMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
it can be an optimization to do it yourself also to make it switch threads only once.reactormonk
04/03/2024, 5:05 PMMofe Ejegi
04/04/2024, 11:05 PM<http://Dispatchers.IO|Dispatchers.IO>
for network requests, client networking libs like Ktor and Apollo Kotlin (GraphQL) already implement it by default in their libraries.
I believe Room DB also does this (not 100% sure).
Sources: Ktor, Apollo KotlinRobert Williams
04/05/2024, 10:03 AMRobert Williams
04/05/2024, 10:04 AMRobert Williams
04/05/2024, 10:06 AMrunInterruptible(dispatcher)
which does the same but works better for some Java blocking methods (people are going to hate this even more so I'm going to leave now homer disappear)