New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writable Streams #163
Comments
So a question that I don't feel knowledgeable enough to file an issue on yet: There are a few places where the spec describes how backpressure on a stream works, but I'm having trouble figuring out where those concepts are exposed in the API. But it might be that I'm not used to reading this style of specification. Where is the API that explains how backpressure works? (If there's an answer, it might be clearer if the introductory spec sections, e.g., the "Model" section (2) and the "Using Writable Streams" section (4.1) had more links into the more technical parts of the specification?) |
I guess the
Perhaps this should at least explain the logic of the separation a little bit further so that future spec editors can extend the platform in reasonable ways without messing up the design? But it's interesting that backpressure itself appears to be signaled just as a boolean. @travisleithead was wondering how well the backpressure approach here extends to things like media streams, where backpressure might be handled by doing things like reducing resolution rather than by writing the same data more slowly. Is more than just a boolean backpressure signal needed to handle that? |
Thanks for requesting a review! Streams are a very exciting addition to the platform. Thanks for doing this work. I'm assuming that reader.close() releases the lock and closes the writer, and that subsequent calls to getWriter will create a new writer for the same stream, but I was a bit confused in the spec by the closeRequest slot which gave me the impression that calling close on a writer closes the stream itself. Like David I'm not familiar enough with this to file an issue and it may not need anything from us. |
Looked it over, aside from learning a lot, I don't have any additional comments. Looks good. |
@dbaron Backpressure is largely implicit, based on the principle that stuff should "just work". An underlying sink signals backpressure by not resolving the promise it returned from One point that perhaps could be stated more clearly is that for optimum throughput the My hope is that I think the bitrate of a media stream needs to be set based on the throughput. Streams don't attempt to measure the throughput, leaving this to applications that need it. Regarding
I believe this is because we intend to add a |
It's actually I didn't realise that the semantics were confusing. Thank you for the feedback. |
@ricea wrote in #163 (comment) :
Ah, so I guess the internal [[backpressure]] slot on I'm still curious if you've thought through whether backpressure works well for media streams. |
I think so, by analogy with TCP/IP. The network stack does careful accounting of window sizes, but all that is exposed to user space is "can write now" or "can't write now". I am expecting to start initial work on integration between media and streams in the next few months. Backpressure is one area I am very confident in. I know @domenic considered many more use cases in the design of backpressure for streams, so he will probably have more to say here. |
About backpressure vs. [[backpressure]], I wouldn't say [[backpressure]] is an important underlying concept. The user-facing API is much more than a boolean, it's the desiredSize number which tells you "how close" you are getting to backpressure kicking in. The [[backpressure]] internal slot is more of a bookkeeping device to allow caching the computation of "desiredSize >= 0". |
It seems like the feedback we gave earlier is taken on board here, the design is stable and we don't have any further feedback to add at this point. Thank you for flying TAG, come again soon. |
Hello TAG!
I'm requesting a TAG review of:
Further details (optional):
You should also know that...
As this specification is for a base primitive applicable across all platforms, it does not use Web IDL, but instead is written in the style of the JavaScript specification.
We'd prefer the TAG provide feedback as (please select one):
The text was updated successfully, but these errors were encountered: