[streams] Add "when are streams appropriate" (#360)

Not sure if this belongs in the spec or in something more dedicated like http://www.w3.org/2001/tag/doc/promises-guide#when-to-use

Candidates, for readable streams:

- Consumers care about every value, and do not want to miss any
- Errors are either final and non-recoverable (socket closed, stream goes into errored state), or just part of the protocol (404, just part of the data stream)
- Single consumer by default (you tee a stream and hand out the two branches for multi-consumer)
- Best when connected to some underlying I/O source, especially one for which backpressure has meaning.
- Best when concatenating all the values in the stream would give something meaningful. (Is this actually important, or is it just true in the cases we've been considering?)

This came up when considering whether streams were a good fit for https://webbluetoothcg.github.io/web-bluetooth/#bluetoothgattcharacteristic. After talking with @jyasskin I eventually concluded that they're not, since in that case, even though there is an underlying I/O source, most of the other points mentioned don't quite fit.

This might be part of #126.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/360

Received on Friday, 5 June 2015 16:11:09 UTC