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

r4zzz4k

01/15/2018, 8:10 PM
I have several functions like this one chained (there may be one or multiple `send`s inside). I'm not sure if this is proper way to break down processing of the data stream. Am I doing something wrong by chance?
Copy code
fun processor(input: ReceiveChannel<A>): ReceiveChannel<B> = produce {
    input.consumeEach {
        ...
        send(...)
    }
}
And if not, is there more idiomatic way to do this chaining?
d

dave08

01/15/2018, 8:59 PM
There's a bunch of operators on channels like in stdlib, unless you need fan in fan out pattern?
3 Views