bod
07/25/2022, 9:45 PMfun main() {
runBlocking {
withContext(Dispatchers.Main) {
println("Hello, World!")
}
}
}
With the new memory manager enabled, the message is never printed, the thread seems to be stuck on withContext
.
I’m not sure if this is to be expected - something like runBlocking
blocking the main thread and making dispatching ineffective? … But then again it feels like this should work, and also looks like a regression since it works with the old MM? 🤔
Any insight would be appreciated! 🙏
Repro project here.Arkadii Ivanov
07/26/2022, 6:31 AMArkadii Ivanov
07/26/2022, 6:37 AMcompletableFromFunction { println() }
.subscribeOn(mainScheduler)
.blockingAwait()
bod
07/26/2022, 6:45 AMbod
07/26/2022, 7:54 AMDispatchers.Main.immediate
avoids the hangArkadii Ivanov
07/26/2022, 8:00 AMArkadii Ivanov
07/26/2022, 8:03 AMbod
07/26/2022, 8:07 AMimmediate
! Wondering if the doc is outdated. Will look at the source 🙂
You are right about not really needing this, just exploring and trying to understand why some of our tests are now failing (well, not failing but hanging).bod
07/26/2022, 8:10 AMArkadii Ivanov
07/26/2022, 8:11 AM