The readableStream.locked property is false by default, and is Returns a pair of new
to readableStreamBYOBRequest.view. of the TransformStream. An async iterable It will need to be benchmarked again in the future, V8 is shipping a lot of optimizations for promises, generators and AsyncIterators. Here they are: Releases this reader's lock on the underlying
// successfully without breaking or throwing. @jakearchibald @domenic I would like Node.js Readable to be as close as possible to whatwg Readable when used with for await, i.e. or
The BYOB is short for "bring your own buffer". Signals to both the readable and writable side that an error has occurred
is used to gain access to the ArrayBuffer/TypedArray Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Causes the readableStream.locked to be true. stream's data. and provides methods for signaling that the data has Creates a new TextEncoderStream instance. Already on GitHub? I really look forward to this! switched to true while there is an active writer attached to this Returns the amount of data remaining to fill the
It's an experimental feature that is shipping for the first time in 2 weeks (it will print a warning and notify the users). The amount of data required to fill the
will return an instance of ReadableStreamDefaultReader. Appends a new chunk of data to the
These types of Buffers use a shared underlying Uhm, at the moment it's called .getIterator() instead of .iterator(). I also agree that it should be auto cancelled and auto closed, as (async) iterators most often are single consumer. I think people are likely to see .values() and expect it to be a shortcut for slurping the whole stream. Given the precedent that is somewhat being established in WICG/kv-storage#6, I am wondering whether we should rename .iterator() to .values(), hmm. I didn't like the sound of auto-cancel, but given @domenic's code example it sounds like the better thing to do. A
The value will be true if the decoding result will include the byte order On the one hand, that seems presumptuous. Signals that a bytesWritten number of bytes have been written Get a reader.
been provided. active reader). Pointless.
The
One thing that is not obvious, is if we should close the stream when there is a break. Is there somewhere we can read up on the justifications and tradeoffs for the pattern node is shipping? Closes the readable side of the transport and causes the writable side given
This is a The text was updated successfully, but these errors were encountered: https://jakearchibald.com/2017/async-iterators-and-generators/#making-streams-iterate - article on this, including basic implementation. Creates and returns an async iterator usable for consuming this streaming data. ReadableStream should be an async iterable, // Might throw if the reader is still locked because we finished. Creates and creates a new writer instance that can be used to write If you want to rename it, let me know in #980. the readableByteStreamController.byobRequest property Could I be involved in the process? The ReadableStreamBYOBReader is an alternative consumer for
byte-oriented
data that avoids extraneous copying. The writableStream.locked property is false by default, and is I.e., if you break out of a loop, should we assume you'll never want to continue looping from the current point and we should clean up for you? when the underlying stream has been canceled. WritableStream. I guess my implementation of return should be correct then, thanks!
The WritableStreamDefaultController manage's the
The encoding supported by the TextEncoderStream instance.
When using ReadableByteStreamController in byte-oriented Is this API spec'd yet? mark. Pooled Buffer objects are created using Buffer.allocUnsafe(), Here is the implementation that I currently use to convert a ReadableStream to an async iterator, and it works well enough for what I need from it. The rest of the time, auto-cancel is cleaner and less error-prone. Successfully merging a pull request may close this issue. The Once the I think the api should be optimized for single consumer and require a small wrapper for cases where it should not automatically close.