Re: [streams] Real time source and skipping (#383)

As a user, I see 2 possible APIs:
- Ability to query the stream/reader to know the size of the queue / if the queue is empty.  An option for a non pulling read would work to. These would basically allow the consumer to manually drain the queue until the last chunk without the risk of waiting for the source to produce more values.
- A "caching strategy" set by the consumer on the reader (or stream? if #375 option A is not accepted). Options for the strategy could be "queue all" (current behavior), "keep oldest" (i.e. discard new values when queue size is reaching high water mark), "keep newest" (i.e. remove old values from queue when its size is reaching high water mark).

The advantage of the second approach is that there would be no extra buffering if the consumer is not interested in the intermediate values. The first approach requires to keep values in the cues until the consumer comes around and discards them manually.

I need to give some thought to a proper API change proposal, but that's my thinking so far.

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

Received on Friday, 31 July 2015 00:41:11 UTC