Repository navigation
streams: implement Readable.from async iterator utility - #27660
Closed
guybedford wants to merge 1 commit into
Closed
guybedford wants to merge 1 commit into
guybedford wants to merge 1 commit into
Conversation
Collaborator
Member
|
fun fact: web streams are also async iterators :P |
devsnek
approved these changes
May 12, 2019
benjamingr
reviewed
May 12, 2019
benjamingr
reviewed
May 12, 2019
benjamingr
reviewed
May 12, 2019
benjamingr
reviewed
May 12, 2019
benjamingr
reviewed
May 12, 2019
benjamingr
left a comment
Member
There was a problem hiding this comment.
Added some comments, generally LGTM and 👍
Member
@devsnek oh cool that means you ended up following through and making that change? |
mihalskiy
approved these changes
May 12, 2019
lpinca
reviewed
May 12, 2019
targos
reviewed
May 12, 2019
targos
reviewed
May 12, 2019
targos
reviewed
May 12, 2019
targos
reviewed
May 12, 2019
jasnell
approved these changes
May 12, 2019
targos
approved these changes
May 13, 2019
benjamingr
approved these changes
May 13, 2019
benjamingr
left a comment
Member
There was a problem hiding this comment.
This is great, thanks for this and for the changes 🙇
I think this, its counterpart of readable streams being async iterable, once promisify, its counterpart callbackify and the promise warnings mean we finally have a good async story for Node.js
I'm excited :D
addaleax
approved these changes
May 13, 2019
Trott
reviewed
May 14, 2019
Collaborator
Collaborator
| (async function() { | ||
| for await (const chunk of iterator) { | ||
| // Handle backpressure on write | ||
| if (!writeable.write(value)) |
Member
There was a problem hiding this comment.
Should be chunk, feel free to open a PR.
6 of 16 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements a
Readable.fromutility method for easily converting async iterators into readable streams.The implementation and approach are taken directly from the
toReadableimplementation in https://github.com/mcollina/stream-iterators-utils.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes