manlan
08/14/2020, 5:26 AMasync
?
(When I am already in the context
of the IO Dispatcher)?gildor
08/14/2020, 5:40 AMsuspend fun <T> GeocodingApiRequest<T>.awaitAsync() = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
await()
}
manlan
08/14/2020, 6:20 AMgildor
08/14/2020, 6:21 AMThere’s no extra code. It’s the same code in a suspend function.But in this case you don’t need async, it does nothing, just unnecessary wrapping withContext is enough
Dominaezzz
08/14/2020, 11:57 AMrunInterruptible(<http://Dispatchers.IO|Dispatchers.IO>)
instead of withContext(<http://Dispatchers.IO|Dispatchers.IO>)
when blocking.gildor
08/14/2020, 12:01 PMDominaezzz
08/14/2020, 12:02 PMgildor
08/14/2020, 12:06 PMDominaezzz
08/14/2020, 12:11 PMgildor
08/14/2020, 12:12 PMDominaezzz
08/14/2020, 12:18 PMmanlan
08/14/2020, 5:08 PMgildor
08/15/2020, 3:38 AM