Deprecate WritableStream::removeSink #2064
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
removeSink is used to extract the WritableStreamSink that is owned by a WritableStream using the original implementation. It is currently used in only three places in the codebase, two of which are unnecessary. There are two pending changes refactoring those two places to avoid using
removeSink()
as currently defined. Replacing the version ofremoveSink
that returns theWritableStreamSink
with adetach()
method that returns nothing covers the sockets use case where we call the method then immediately throw away the sink.Opening this to broadcast the intent in case folks have reason to keep removeSink around.
Once this and the two other PRs land, we hopefully move towards removing removeSink entirely. Note that ultimately the goal is to entirely eliminate the need for (and remove entirely) the
WritableStreamInternalController
as a separate implementation, making it such that allWritableStream
use cases can be served by theWritableStreamJsController
implementation. This, however, raises an issue with the JSRPC implementation which usesremoveSink()
in the implementation ofWritableStream::serialize()
. JS-backed WritableStreams are currently not supported by JSRPC. We will need to address that limitation before being able to proceed here. FWIW, the use ofremoveSink()
in JSRPC does not actually require the public method onWritableStream
to work, so that's not a blocker.Refs: #2061
Refs: #2050