Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Created January 18, 2020 22:05
Show Gist options
  • Save CostaFot/195dde8c760f3d1c15afe29e34603d68 to your computer and use it in GitHub Desktop.
Save CostaFot/195dde8c760f3d1c15afe29e34603d68 to your computer and use it in GitHub Desktop.
interface DispatcherProvider {
val io: CoroutineDispatcher
val ui: CoroutineDispatcher
val default: CoroutineDispatcher
val unconfined: CoroutineDispatcher
}
class DefaultDispatcherProvider(
override val ui: CoroutineDispatcher = Dispatchers.Main,
override val default: CoroutineDispatcher = Dispatchers.Default,
override val io: CoroutineDispatcher = Dispatchers.IO,
override val unconfined: CoroutineDispatcher = Dispatchers.Unconfined
) : DispatcherProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment