Skip to content

Instantly share code, notes, and snippets.

@jeziellago
Created December 10, 2019 03:27
Show Gist options
  • Save jeziellago/77cdbf77763f2cb2173f7ccff4474839 to your computer and use it in GitHub Desktop.
Save jeziellago/77cdbf77763f2cb2173f7ccff4474839 to your computer and use it in GitHub Desktop.
Channel Interfaces
interface SendChannel<in E> {
suspend fun send(element: E)
fun close(): Boolean
}
interface ReceiveChannel<out E> {
suspend fun receive(): E
}
interface Channel<E> : SendChannel<E>, ReceiveChannel<E>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment