I have several functions like this one chained (th...
# coroutines
r
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
There's a bunch of operators on channels like in stdlib, unless you need fan in fan out pattern?