Created
November 7, 2018 18:43
-
-
Save mayojava/57c75f99191f2548795fc1929e5c2fe6 to your computer and use it in GitHub Desktop.
Send and Receive channel interfaces
This file contains hidden or 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
| 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