Dan Gohman on Nostr: Contrasting stream concepts: - streams as *channels*. First-class handles for the ...
Contrasting stream concepts:
- streams as *channels*. First-class handles for the read and write ends.
- streams as *coroutine creaters*. Functions with `stream` args or `stream` returns are like a coroutine consuming elements from the input streams and producing elements to the return streams.
Most of my experience is with channel style. In coroutine style, I sometimes think "what if someone passes you an output stream and then..." before remembering that that isn't a thing.
- streams as *channels*. First-class handles for the read and write ends.
- streams as *coroutine creaters*. Functions with `stream` args or `stream` returns are like a coroutine consuming elements from the input streams and producing elements to the return streams.
Most of my experience is with channel style. In coroutine style, I sometimes think "what if someone passes you an output stream and then..." before remembering that that isn't a thing.