Last active
July 13, 2019 21:01
-
-
Save RBusarow/2f6bbf1df696b3cff452846d24179ba0 to your computer and use it in GitHub Desktop.
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
class SomeCoroutineScopeClass : CoroutineScope { | |
override val coroutineContext: CoroutineContext | |
init { | |
val receiver: CoroutineContext = Job() | |
val other: CoroutineContext = Dispatchers.Main | |
// combine two contexts to create an entirely new instance | |
val newContext: CoroutineContext = receiver + other | |
coroutineContext = newContext | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment