https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

bazted

02/09/2018, 11:16 AM
Hello, I may have strange question, but how can I create some
onComplete
like listener for ReceiveChannel. for now I have
Copy code
fun <T> ReceiveChannel<T>.onComplete(action: suspend () -> Unit): ReceiveChannel<T> {
    launch(Unconfined) {
        consumeEach { }
        action()
    }
    return this
}
e

elizarov

02/09/2018, 9:51 PM
Fot now that is the way to do it.
6 Views