Skip to content

Commit 1ee4e0c

Browse files
authored
Merge pull request #190 from shaseley/use-abortcontroller-signal
Editorial: Use AbortController/signal to access controller's signal
2 parents 6701f98 + f3bd156 commit 1ee4e0c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.bs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ At construction of each {{RTCRtpSender}} or {{RTCRtpReceiver}}, run the followin
111111
1. If [=this=].`[[pipeToController]]` is not null, abort these steps.
112112
2. Set [=this=].`[[pipeToController]]` to a new {{AbortController}}.
113113
<!-- FIXME: Use pipeTo algorithm when available. -->
114-
3. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with [=this=].`[[readable]]`, [=this=].`[[writable]]`, preventClose equal to true, preventAbort equal to true, preventCancel equal to true and [=this=].`[[pipeToController]]`.signal.
114+
3. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with [=this=].`[[readable]]`, [=this=].`[[writable]]`, preventClose equal to true, preventAbort equal to true, preventCancel equal to true and [=this=].`[[pipeToController]]`'s [=AbortController/signal=].
115115

116116
<p class=note>
117117
Streams backpressure can optimize throughput while limiting processing and memory consumption by pausing data production as early as possible in a data pipeline.
@@ -168,21 +168,21 @@ The `transform` setter steps are:
168168
4. Let |writer| be the result of [=WritableStream/getting a writer=] for |checkedTransform|.`[[writable]]`.
169169
5. Initialize |newPipeToController| to a new {{AbortController}}.
170170
6. If [=this=].`[[pipeToController]]` is not null, run the following steps:
171-
1. [=AbortSignal/Add=] the [$chain transform algorithm$] to [=this=].`[[pipeToController]]`.signal.
171+
1. [=AbortSignal/Add=] the [$chain transform algorithm$] to [=this=].`[[pipeToController]]`'s [=AbortController/signal=].
172172
2. [=AbortController/signal abort=] on [=this=].`[[pipeToController]]`.
173173
7. Else, run the [$chain transform algorithm$] steps.
174174
8. Set [=this=].`[[pipeToController]]` to |newPipeToController|.
175175
9. Set [=this=].`[[transform]]` to |transform|.
176176
10. Run the steps in the set of [$association steps$] of |transform| with [=this=].
177177

178178
The <dfn abstract-op>chain transform algorithm</dfn> steps are defined as:
179-
1. If |newPipeToController|.signal is [=AbortSignal/aborted=], abort these steps.
179+
1. If |newPipeToController|'s [=AbortController/signal=] is [=AbortSignal/aborted=], abort these steps.
180180
2. [=ReadableStreamDefaultReader/Release=] |reader|.
181181
3. [=WritableStreamDefaultWriter/Release=] |writer|.
182182
4. Assert that |newPipeToController| is the same object as |rtcObject|.`[[pipeToController]]`.
183183
<!-- FIXME: Use pipeTo algorithm when available. -->
184-
5. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with |rtcObject|.`[[readable]]`, |checkedTransform|.`[[writable]]`, preventClose equal to false, preventAbort equal to false, preventCancel equal to true and |newPipeToController|.signal.
185-
6. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with |checkedTransform|.`[[readable]]`, |rtcObject|.`[[writable]]`, preventClose equal to true, preventAbort equal to true, preventCancel equal to false and |newPipeToController|.signal.
184+
5. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with |rtcObject|.`[[readable]]`, |checkedTransform|.`[[writable]]`, preventClose equal to false, preventAbort equal to false, preventCancel equal to true and |newPipeToController|'s [=AbortController/signal=].
185+
6. Call <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">pipeTo</a> with |checkedTransform|.`[[readable]]`, |rtcObject|.`[[writable]]`, preventClose equal to true, preventAbort equal to true, preventCancel equal to false and |newPipeToController|'s [=AbortController/signal=].
186186

187187
This algorithm is defined so that transforms can be updated dynamically.
188188
There is no guarantee on which frame will happen the switch from the previous transform to the new transform.

0 commit comments

Comments
 (0)