Skip to content

Instantly share code, notes, and snippets.

@manuelvicnt
Created March 20, 2019 08:18
Show Gist options
  • Save manuelvicnt/929650b1799cbaed97bda85b839e3f3a to your computer and use it in GitHub Desktop.
Save manuelvicnt/929650b1799cbaed97bda85b839e3f3a to your computer and use it in GitHub Desktop.
internal class CloseableCoroutineScope(
context: CoroutineContext
) : Closeable, CoroutineScope {
override val coroutineContext: CoroutineContext = context
override fun close() {
coroutineContext.cancel()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment