You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -547,6 +547,8 @@ The synchronous methods ({{Writer/writeSync()}}, {{Writer/writevSync()}}) operat
547
547
548
548
The asynchronous methods ({{Writer/write()}}, {{Writer/writev()}}) first attempt to place the batch into the slots buffer. If the slots buffer is full, the write is placed into the pending writes queue (for `"strict"` and `"block"` policies). When the consumer reads and frees slots, pending writes are promoted from the pending queue into the slots buffer in order, and their promises resolve.
549
549
550
+
If the bonded readable's consumer stops iterating (the async iterator returns or throws), the writer's consumer is no longer <dfn>active</dfn>. Subsequent synchronous writes return `false` and asynchronous writes reject, since the data has no consumer to receive it.
@@ -564,8 +566,9 @@ The <dfn method for="Writer">write(chunk, options)</dfn> method writes a single
564
566
565
567
<ol>
566
568
<li>If |chunk| is a {{USVString}}, set |chunk| to the result of [=UTF-8 encode|UTF-8 encoding=] |chunk|.
567
-
<li>If the writer is closed, return [=a promise rejected with=] a {{TypeError}}.
569
+
<li>If the writer is closed or [=closing=], return [=a promise rejected with=] a {{TypeError}}.
568
570
<li>If the writer is errored, return [=a promise rejected with=] the stored error.
571
+
<li>If the bonded consumer is not [=active=], return [=a promise rejected with=] a {{TypeError}} (or, if the consumer's iterator threw an error, reject with that error).
569
572
<li>If |options|["{{WriteOptions/signal}}"] is present and [=AbortSignal/aborted=], return [=a promise rejected with=] its abort reason.
570
573
<li>Let |batch| be « |chunk| ».
571
574
<li>If the slots buffer has space, enqueue |batch|, [=notify drain waiters=], and return [=a promise resolved with=] `undefined`.
@@ -593,7 +596,7 @@ The <dfn method for="Writer">writeSync(chunk)</dfn> method attempts a synchronou
593
596
594
597
<ol>
595
598
<li>If |chunk| is a {{USVString}}, set |chunk| to the result of [=UTF-8 encode|UTF-8 encoding=] |chunk|.
596
-
<li>If the writer is closedor errored, return `false`.
599
+
<li>If the writer is closed, [=closing=], or errored, or if the bonded consumer is not [=active=], return `false`.
597
600
<li>Let |batch| be « |chunk| ».
598
601
<li>If the slots buffer has space, enqueue |batch|, [=notify drain waiters=], and return `true`.
599
602
<li>The slots buffer is full. Proceed based on the [=backpressure policy=]:
0 commit comments