Created
December 12, 2021 23:31
-
-
Save chao2zhang/42668f3aa15fc06cde5e39280c2008ad to your computer and use it in GitHub Desktop.
Shared Dispatcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@CoDispatcher(DispatcherType.SHARED) | |
@Singleton | |
@Provides | |
fun sharedDispatcher(threadPoolExecutor: ThreadPoolExecutor): CoroutineDispatcher { | |
return threadPoolExecutor.asCoroutineDispatcher() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment