We plan to introduce `pipe` function for channel-t...
# coroutines
e
We plan to introduce
pipe
function for channel-to-channel transfer. Using
pipe
the code can be made even more natural without constraint on the ordering:
Copy code
fun BluetoothSocket.asyncListen() = produce(context) { ... } // natural-looking producer
fun configIncomingData(): BroadcastChannel<String> { ... } // broadcast consumer
// use it like this:
val producer = asyncListen()
val consumer = configIncomingData()
pipe(producer, consumer)