dMusicb
02/09/2021, 1:28 AMwithContext(InjectThreadContext(...)) {
//doStuff
//otherStuff
//moreStuff
}
So this works in the sense that when the coroutine resumes/starts it'll inject our thread context and right after it suspends we have it restore the original context by closing our injected context. But once we reach the end there is no suspend again so the injected context then leaks out of the block whereas we want it to do like a final close.
Is there a different method we should be using?gildor
02/09/2021, 4:05 AMgildor
02/09/2021, 4:06 AMgildor
02/09/2021, 4:07 AM