Skip to content

Instantly share code, notes, and snippets.

@mayojava
Created November 7, 2018 18:43
Show Gist options
  • Select an option

  • Save mayojava/57c75f99191f2548795fc1929e5c2fe6 to your computer and use it in GitHub Desktop.

Select an option

Save mayojava/57c75f99191f2548795fc1929e5c2fe6 to your computer and use it in GitHub Desktop.
Send and Receive channel interfaces
interface SendChannel<in E> {
public suspend fun send(element: E)
public fun offer(element: E): Boolean
public fun close(cause: Throwable? = null): Boolean
}
interface ReceiveChannel<out E> {
public suspend fun receive(): E
public fun poll(): E?
public fun cancel()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment