gts13
04/06/2023, 1:14 PMwithContext
If I don't want to have issues on main thread?kevin.cianfarini
04/06/2023, 1:32 PMsuspend fun decodeOffMainThread() = withContext(Dispatchers.Default) { /* Your code */ }
// From main thread:
repeat(300) {
coroutineScope.launch {
decodeOffMainThead()
}
}
It’s not required because that function isn’t suspending.