Erik
07/05/2021, 8:12 AMCoroutineContext
from Thread.currentThread()
? I don't control the current thread instance, but I want to specifically switch to it using e.g. withContext(/*..*/) {}
.mbonnin
07/05/2021, 8:14 AMmbonnin
07/05/2021, 8:17 AMmbonnin
07/05/2021, 8:18 AMErik
07/05/2021, 8:19 AMfun <T> ThreadLocal<T>.asContextElement(value: T = get()): ThreadContextElement<T>
insteadmbonnin
07/05/2021, 8:20 AMErik
07/05/2021, 8:21 AMmbonnin
07/05/2021, 8:21 AM<http://Dispatchers.IO|Dispatchers.IO>
has multiple threadsErik
07/05/2021, 8:22 AMmbonnin
07/05/2021, 8:22 AMExecutors.newSingleThreadExecutor().asCoroutineDispatcher()
Erik
07/05/2021, 8:22 AMErik
07/05/2021, 8:22 AM