Skip to content
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

Align WritableStream structure with ReadableStream structure #462

Closed
wants to merge 28 commits into from

Conversation

tyoshino
Copy link
Member

  • Add WritableStreamDefaultWriter
  • Add WritableStreamDefaultController
  • Add lock related methods
  • Update reader.pipeTo() to use the new WritableStream classes

- Add WritableStreamDefaultWriter
- Add WritableStreamDefaultController
- Add lock related methods
- Update reader.pipeTo() to use the new WritableStream classes
@tyoshino
Copy link
Member Author

This is WIP. I'll create some issues to discuss design decisions.

@tyoshino
Copy link
Member Author

@tyoshino
Copy link
Member Author

@tyoshino
Copy link
Member Author

tyoshino commented Jun 1, 2016

@tyoshino
Copy link
Member Author

tyoshino commented Jun 1, 2016

I also started updating TransformStream. It should reveal issues of WritableStream if any.

}

return AcquireWritableStreamDefaultWriter(this);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I know there is a thread on abort(), for now (not having looked at that thread in detail yet) I think we should keep abort() as a lock-abort-unlock, similar to how cancel() on readable streams is lock-cancel-unlock.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, you did that in the follow-up commit; nevermind!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah!

@domenic
Copy link
Member

domenic commented Jun 1, 2016

Wow, thank you so much for taking this on. This is so great.

I wonder what strategy you have in mind for doing this work. For example, IMO it would be valuable to fix writable streams in the ways we know we want to change, and get the spec + tests for them done. All of the stuff in the first two commits seems great to me. Then we could work on transform streams and other less-obvious fixes afterward. What do you think? I am open to doing everything all at once too if you'd prefer that.

Another thing we need to do is convert the existing tests to web platform tests :(. Don't necessarily worry about that for now, but maybe if writing new tests try to keep them in WPT format and directories.

I'll go off to comment on the other issues now!

@tyoshino
Copy link
Member Author

tyoshino commented Jun 2, 2016

it would be valuable to fix writable streams in the ways we know we want to change,

Yeah. There some experimental features are implemented in this PR, but they'll be reverted and this PR would just include only what we agreed e.g. writer introduction.

@tyoshino
Copy link
Member Author

All tests pass except for skipped ones which are related to the locking semantics. I'll fix them and then tweak it / fix style issues.

@@ -578,14 +578,15 @@ class WritableStreamDefaultController {
const startResult = InvokeOrNoop(underlyingSink, 'start', [this]);
Promise.resolve(startResult).then(
() => {
throw new assert.AssertionError('ss');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to commit this line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Removed

@tyoshino
Copy link
Member Author

tyoshino commented Aug 1, 2016

Moved to #488 to keep all the logs while making the PR rebased and squashed for easier review.

@tyoshino tyoshino closed this Aug 1, 2016
@tyoshino tyoshino deleted the writablestreamwriter branch August 1, 2016 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants