Skip to content

Instantly share code, notes, and snippets.

@Malinskiy
Last active March 7, 2019 16:23
Show Gist options
  • Save Malinskiy/744f46075d458bffcc693c9381042643 to your computer and use it in GitHub Desktop.
Save Malinskiy/744f46075d458bffcc693c9381042643 to your computer and use it in GitHub Desktop.
abstract class Actor<in T>(parent: Job? = null,
val context: CoroutineContext) : SendChannel<T>, CoroutineScope {
override suspend fun send(element: T) = delegate.send(element)
protected abstract suspend fun receive(msg: T)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment