- From: Takeshi Yoshino <notifications@github.com>
- Date: Thu, 26 Feb 2015 20:54:01 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/pull/288/c76332480@github.com>
> Where would you put released ...
This was comment about the functionality we have that we can wait for release of the reader by then()-ing `rs.ready()`. I suggested that if we really want to do that, I'd realize it as `rs.released()` than `rs.ready()`.
Sorry for not elaborating motivation/context about this proposal much. But this was from analysis about what states we should have for WritableStream with Writer I did yesterday.
Here is a list of states in the form of `X -> A, B, C, ...` where X is state name or a name of a group of states and A, B, C, ... are the states X may transit to. Sorry but this is written for WritableOperationStream, not WritableStream.
- "locked" -> available
- available -> "locked"
- (write()/close() are allowed) -> "closed", "aborted", "cancelled", "errored"
- "writable" (backpressure applied) -> "waiting"
- "waiting" (backpressure not applied) -> "writable"
- "closed" -> "aborted", "cancelled", "errored"
- "aborted"
- "cancelled"
- "errored"
For convenience, `ready` on `WritableStream` is catching all transitions from `"waiting"`. But, transitions that may happen unsolicitedly to the user of the stream are actually a few of them. For WritableOperationStream's case:
- locked -> something
- something -> errored
- something -> writable
I thought it may lead to simplification in general if we have sufficient enough promises for capturing only these transition. Sorry, I cannot give concrete rationale for now. But this is background...
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/288#issuecomment-76332480
Received on Friday, 27 February 2015 04:54:30 UTC