- From: Adam Rice <notifications@github.com>
- Date: Mon, 05 Apr 2021 10:03:21 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1113/review/627985717@github.com>
@ricea approved this pull request. lgtm with nits. > @@ -6563,6 +6550,59 @@ Streams</cite> is an example of this technique, with its `sender.createEncodedSt Despite such endpoint pairs obeying the `readable`/`writable` property contract, it never makes sense to pass them to {{ReadableStream/pipeThrough()}}. +<h3 id="other-specs-piping">Piping</h3> + +<div algorithm="ReadableStream pipe to"> + The result of a {{ReadableStream}} |readable| <dfn export for="ReadableStream" lt="pipe|pipe + to|piped to|piping to">piped to</dfn> to a {{WritableStream}} |writable|, given an optional ```suggestion to|piped to|piping to">piped to</dfn> a {{WritableStream}} |writable|, given an optional ``` > @@ -6563,6 +6550,59 @@ Streams</cite> is an example of this technique, with its `sender.createEncodedSt Despite such endpoint pairs obeying the `readable`/`writable` property contract, it never makes sense to pass them to {{ReadableStream/pipeThrough()}}. +<h3 id="other-specs-piping">Piping</h3> + +<div algorithm="ReadableStream pipe to"> + The result of a {{ReadableStream}} |readable| <dfn export for="ReadableStream" lt="pipe|pipe + to|piped to|piping to">piped to</dfn> to a {{WritableStream}} |writable|, given an optional + boolean <dfn export for="ReadableStream/pipe to"><var>preventClose</var></dfn> (default false), an Should this be `"ReadableStream/piped to"` to match the primary definition, or not? > + 1. Return ! [$ReadableStreamPipeTo$](|readable|, |writable|, |preventClose|, |preventAbort|, + |preventCancel|, |signalArg|). + + <p class="note">If one doesn't care about the promise returned, referencing this concept can be a + bit awkward. The best we can suggest is "[=ReadableStream/pipe=] <var ignore>readable</var> to <var + ignore>writable</var>".</p> +</div> + +<div algorithm="ReadableStream pipe through"> + The result of a {{ReadableStream}} |readable| <dfn export for="ReadableStream" lt="pipe + through|piping through">piped through</dfn> a {{TransformStream}} |transform|, given an optional + boolean <dfn export for="ReadableStream/pipe through"><var>preventClose</var></dfn> (default + false), an optional boolean <dfn export for="ReadableStream/pipe + through"><var>preventAbort</var></dfn> (default false), an optional boolean <dfn export + for="ReadableStream/pipe through"><var>preventCancel</var></dfn> (default false), and an optional + {{AbortSignal}} <dfn export for="ReadableStream/pipe through"><var>signal</var></dfn>, perform the ```suggestion {{AbortSignal}} <dfn export for="ReadableStream/pipe through"><var>signal</var></dfn>, is given by performing the ``` > + |preventCancel|, |signalArg|). + + <p class="note">If one doesn't care about the promise returned, referencing this concept can be a + bit awkward. The best we can suggest is "[=ReadableStream/pipe=] <var ignore>readable</var> to <var + ignore>writable</var>".</p> +</div> + +<div algorithm="ReadableStream pipe through"> + The result of a {{ReadableStream}} |readable| <dfn export for="ReadableStream" lt="pipe + through|piping through">piped through</dfn> a {{TransformStream}} |transform|, given an optional + boolean <dfn export for="ReadableStream/pipe through"><var>preventClose</var></dfn> (default + false), an optional boolean <dfn export for="ReadableStream/pipe + through"><var>preventAbort</var></dfn> (default false), an optional boolean <dfn export + for="ReadableStream/pipe through"><var>preventCancel</var></dfn> (default false), and an optional + {{AbortSignal}} <dfn export for="ReadableStream/pipe through"><var>signal</var></dfn>, perform the + following steps. The result will the [=readable side=] of |transform|. ```suggestion following steps. The result will be the [=readable side=] of |transform|. ``` > + {{Promise}} that fulfills when the pipe completes, or rejects with an exception if it fails. + + 1. Assert: ! [$IsReadableStreamLocked$](|readable|) is false. + 1. Assert: ! [$IsWritableStreamLocked$](|writable|) is false. + 1. Let |signalArg| be |signal| if |signal| was given, or undefined otherwise. + 1. Return ! [$ReadableStreamPipeTo$](|readable|, |writable|, |preventClose|, |preventAbort|, + |preventCancel|, |signalArg|). + + <p class="note">If one doesn't care about the promise returned, referencing this concept can be a + bit awkward. The best we can suggest is "[=ReadableStream/pipe=] <var ignore>readable</var> to <var + ignore>writable</var>".</p> +</div> + +<div algorithm="ReadableStream pipe through"> + The result of a {{ReadableStream}} |readable| <dfn export for="ReadableStream" lt="pipe + through|piping through">piped through</dfn> a {{TransformStream}} |transform|, given an optional Question: do we want to require a `{{TransformStream}}`, or would the `[=transform stream=]` concept be sufficient here? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/1113#pullrequestreview-627985717
Received on Monday, 5 April 2021 17:03:34 UTC