mbonnin
06/01/2021, 5:45 PMDispatchers.Unconfined
do if it ever needs to dispatch ?
runBlocking {
withContext(Dispatchers.Unconfined) {
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
// do something in IO here
}
// I am still in an IO thread
delay(10) // dispatch
// what thread am I here?
}
}
Adam Powell
06/01/2021, 6:18 PMcontinuation.resume()
from whatever caused it to be resumedmbonnin
06/01/2021, 6:20 PMcontinuation.resume()
after the 10ms delay?withContext(<http://Dispatchers.IO|Dispatchers.IO>) {}
calls me back in IO
context. But the delay
, I'm not sure how it's going to resume. I would somehow expect to fallback to the dispatcher from the initial runBlocking
but that doesn't seem to be the case.Adam Powell
06/01/2021, 6:24 PMmbonnin
06/01/2021, 6:24 PMrunBlocking {
withContext(Dispatchers.Unconfined) {
delay(10) // dispatch
// what thread am I here?
}
}
Default
is what I'm observingAdam Powell
06/01/2021, 6:25 PMDispatchers.Unconfined
🙂mbonnin
06/01/2021, 6:26 PM