Skip to content

Instantly share code, notes, and snippets.

@omkar-tenkale
Created June 3, 2023 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omkar-tenkale/6ae94334a110a6948fe3b3f7e4e85631 to your computer and use it in GitHub Desktop.
Save omkar-tenkale/6ae94334a110a6948fe3b3f7e4e85631 to your computer and use it in GitHub Desktop.
sealed class Dispatcher: CoroutineContext.Element {
object Main : Dispatcher()
object Background : Dispatcher()
override val key = DispatcherKey
}
object DispatcherKey: CoroutineContext.Key<Dispatcher>{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment