Extensions for kotlinx.coroutines.experimental.channels.ReceiveChannel

asStream

fun <E : Any> ReceiveChannel<E>.asStream(): Stream<E>

Creates a Stream of elements in this ReceiveChannel.

collect

suspend fun <T, A : Any, R> ReceiveChannel<T>.collect(
    collector: Collector<T, A, R>
): R

Applies the collector to the ReceiveChannel