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

A cursor position stream would only provide new values when the position has changed, not constantly. When moving, new values are produced and queued in the stream. When not moving, no new values are produced. Now as a consumer, if I don't read while new values are produced, I want to be able to "fast-forward" to the latest value in the stream, without having to wait for a new value to be produced by the source. Since there is no way to know if a read from a stream will just pull from the queue or wait for a new value, this is not possible to accomplish.

Similarly the controller of the readable stream cannot correctly respect the back pressure since it would always have to enqueue at least one value to receive the back pressure signal, and skip new values. At that point, the value that will be read next from the stream will be that "old" value that was queued, not any newer value that might have been generated by the source since then. This is the "first-in" case that I mentioned, which is not the desired behavior.

Regardless, this requires the client to ask for a special stream with "skipping" behavior. This behavior cannot be driven by the consumer of the stream after the stream already exists.

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

Received on Thursday, 30 July 2015 19:25:52 UTC