Is there any way to retrieve the dispatcher from a coroutine context?
a
Adam Powell
10/08/2019, 1:56 AM
yes, but there generally isn't a lot of reason to, why?
e
eygraber
10/08/2019, 2:18 AM
I'm wrapping a 3rd party API that expects an executor in a
suspendCancellableCoroutine
. I want to be able to get the dispatcher from the continuation's context and turn that into an executor
a
Adam Powell
10/08/2019, 2:24 AM
thought that might be it. 🙂 You don't need to. Use a directExecutor and just resume the continuation with the right result, it'll dispatch to the right CoroutineDispatcher as part of resuming the continuation