-
Notifications
You must be signed in to change notification settings - Fork 155
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
Implement teeing, plus a bunch of stage-setting tweaks #311
Commits on Apr 6, 2015
-
Factor out a new CloseReadableStream abstract operation
For the tee algorithm being drafted in #302, it's important to have an abstract operation CloseReadableStream that does all the things that ReadableStreamController.prototype.close does. So, we factor that out. The old CloseReadableStream is renamed to "FinishClosingReadableStream".
Configuration menu - View commit details
-
Copy full SHA for fee2191 - Browse repository at this point
Copy the full SHA fee2191View commit details -
Factor out a new EnqueueInReadableStream abstract operation
Similarly to the previous commit, we want this for defining the tee algorithm (and potentially others, e.g. from other specifications).
Configuration menu - View commit details
-
Copy full SHA for 90c0a9b - Browse repository at this point
Copy the full SHA 90c0a9bView commit details -
Tidy up precondition checking in ErrorReadableStream
Following the established pattern, public API methods should throw if preconditions are violated, whereas abstract operations should assert that they are not.
Configuration menu - View commit details
-
Copy full SHA for 4b362dd - Browse repository at this point
Copy the full SHA 4b362ddView commit details -
Add and update notes on using abstract ops from other specs
In particular, https://github.com/yutakahirano/fetch-with-streams is an obvious client for all of the ones noted.
Configuration menu - View commit details
-
Copy full SHA for 62b8a68 - Browse repository at this point
Copy the full SHA 62b8a68View commit details -
Factor out ReadFromReadableStreamReader abstract operation
Again, needed for formalizing the tee algorithm from #302.
Configuration menu - View commit details
-
Copy full SHA for 05674df - Browse repository at this point
Copy the full SHA 05674dfView commit details -
Tweak spec mechanics of WritableStream Error Functions
Instead of creating a closure in the constructor, storing it on the stream, and calling this@[[error]] all the time, we can instead abstract out an ErrorWritableStream(stream, e) abstract operation and call that when appropriate. Then, the WritableStream error functions just delegate to this abstract operation. The big upside of this is that, if the error function ends up not being used by the underlying sink (e.g. the underlying sink relies on returning rejected promises instead), we can immediately garbage-collect it, instead of carrying it around for the lifetime of the stream. While doing so, make the editorial move to ES-spec-style closures, with internal slots, instead of using the "closing over" technique. It turns out that when you try to extend the "closing over" language to more complicated situations (as we will do for teeing), it falls over, becoming very confusing. The ES-spec version of closures is obtuse, but works. Finally, we now put the definitions of closures underneath the place that creates them (in this case the constructor), instead of creating a whole new CreateWritableStreamErrorFunction abstract operation, defined some distance from the relevant function. This will serve us well for tee and pipe.
Configuration menu - View commit details
-
Copy full SHA for cde727e - Browse repository at this point
Copy the full SHA cde727eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ed32a5 - Browse repository at this point
Copy the full SHA 3ed32a5View commit details