Re: [whatwg/streams] Factor out condition to check pending operation (#672)

ricea commented on this pull request.



> @@ -2681,24 +2694,24 @@ WritableStream(<var>underlyingSink</var> = {}, { <var>size</var>, <var>highWater
 </div>
 
 <div class="note">
-  Due to the way writable streams asynchronously close, it is possible for both <code>close</code> and
-  <code>abort</code> to be called, in cases where the <a>producer</a> aborts the stream while it is in the
-  <code>"closing"</code> state. Notably, since a stream always spends at least one turn in the <code>"closing"</code>
-  state, code like <code>ws.close(); ws.abort(...);</code> will cause both to be called, even if the <code>close</code>
-  method itself has no asynchronous behavior. A well-designed <a>underlying sink</a> object should be able to deal with
-  this.
+  The \[[inFlightCloseRequest]] slot and \[[closeRequest]] slot are mutually exclusive. No element will be removed from
+  \[[writeRequests]] while \[[inFlightWriteRequest]] is not <code>undefined</code>. Implementations may optimize the way
+  to hold these slots based on these assumptions.

These are invariants, not assumptions. Sorry I failed to spot this earlier.

-- 
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/672#pullrequestreview-25961142

Received on Thursday, 9 March 2017 07:13:23 UTC