-
Notifications
You must be signed in to change notification settings - Fork 1.9k
consider exposing the Executor from a CoroutineDispatcher. #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why |
Sorry for the delay. That is going from executor to dispatcher. I think going from dispatcher (CommonPool, ThreadPoolDispatcher) back should be possible as well. Its quite common to be in a coroutine and have to interact with something expecting an executor and that the executor should be the same pool. If the graph is wired up through di you would have to bind an underlying executor as well as a dispatcher. If you only bind and executor and go from to executor to dispatcher thats extra allocation each time no ? |
Hi @hsyed One of the solutions is to provide access to the underlying executor for executor-based dispatchers ( |
@qwwdfsad Yes that is what I was thinking of. |
In various contexts (--e.g., dagger2 producers, various guava async utils) the
Executor
could be the same as the coroutine dispatcher. Could we get access to the executor so that we can use it directly at least onCommonPool
and user createdThreadPoolDispatcher
. Having to inject both or provide both is annoying.The text was updated successfully, but these errors were encountered: