streams: implement Readable.from async iterator utility#27660
Closed
guybedford wants to merge 1 commit intonodejs:masterfrom
Closed
streams: implement Readable.from async iterator utility#27660guybedford wants to merge 1 commit intonodejs:masterfrom
guybedford wants to merge 1 commit intonodejs:masterfrom
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
Member
benjamingr
left a comment
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
Member
benjamingr
left a comment
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
guybedford
added a commit
that referenced
this pull request
May 18, 2019
PR-URL: #27660 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
targos
pushed a commit
that referenced
this pull request
May 18, 2019
PR-URL: #27660 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
BridgeAR
added a commit
that referenced
this pull request
May 21, 2019
Notable changes:
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
BridgeAR
added a commit
that referenced
this pull request
May 21, 2019
Notable changes:
* esm:
* Added the `--experimental-wasm-modules` flag to support
WebAssembly modules (Myles Borins & Guy Bedford)
#27659
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
PR-URL: #27799
BridgeAR
added a commit
that referenced
this pull request
May 21, 2019
Notable changes:
* esm:
* Added the `--experimental-wasm-modules` flag to support
WebAssembly modules (Myles Borins & Guy Bedford)
#27659
* process:
* Log errors using `util.inspect` in case of fatal exceptions
(Ruben Bridgewater) #27243
* repl:
* Add `process.on('uncaughtException')` support (Ruben Bridgewater)
#27151
* stream:
* Implemented `Readable.from` async iterator utility (Guy Bedford)
#27660
* tls:
* Expose built-in root certificates (Ben Noordhuis)
#26415
* Support `net.Server` options (Luigi Pinca)
#27665
* Expose `keylog` event on TLSSocket (Alba Mendez)
#27654
* worker:
* Added the ability to unshift messages from the `MessagePort`
(Anna Henningsen) #27294
PR-URL: #27799
| (async function() { | ||
| for await (const chunk of iterator) { | ||
| // Handle backpressure on write | ||
| if (!writeable.write(value)) |
Contributor
There was a problem hiding this comment.
where does value come from?
Member
There was a problem hiding this comment.
Should be chunk, feel free to open a PR.
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
16 tasks
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
imcotton
added a commit
to imcotton/DefinitelyTyped
that referenced
this pull request
Jun 11, 2019
Added in v12.3.0 from PR nodejs/node#27660
BethGriggs
pushed a commit
that referenced
this pull request
Oct 17, 2019
PR-URL: #27660 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Merged
BethGriggs
added a commit
that referenced
this pull request
Oct 22, 2019
Notable changes:
* crypto:
* add support for chacha20-poly1305 for AEAD (chux0519)
#24081
* increase maxmem range from 32 to 53 bits (Tobias Nießen)
#28799
* deps:
* update npm to 6.11.3 (claudiahdz)
#29430
* upgrade openssl sources to 1.1.1d (Sam Roberts)
#29921
* dns:
* remove dns.promises experimental warning (cjihrig)
#26592
* fs:
* remove experimental warning for fs.promises (Anna Henningsen)
#26581
* http:
* makes response.writeHead return the response (Mark S. Everitt)
#25974
* http2:
* makes response.writeHead return the response (Mark S. Everitt)
#25974
* n-api:
* make func argument of napi\_create\_threadsafe\_function optional
(legendecas)
#27791
* mark version 5 N-APIs as stable (Gabriel Schulhof)
#29401
* implement date object (Jarrod Connolly)
#25917
* process:
* add --unhandled-rejections flag (Ruben Bridgewater)
#26599
* stream:
* implement Readable.from async iterator utility (Guy Bedford)
#27660
* make Symbol.asyncIterator support stable (Matteo Collina)
#26989
PR-URL: #29875
BethGriggs
added a commit
that referenced
this pull request
Oct 22, 2019
Notable changes:
* crypto:
* add support for chacha20-poly1305 for AEAD (chux0519)
#24081
* increase maxmem range from 32 to 53 bits (Tobias Nießen)
#28799
* deps:
* update npm to 6.11.3 (claudiahdz)
#29430
* upgrade openssl sources to 1.1.1d (Sam Roberts)
#29921
* dns:
* remove dns.promises experimental warning (cjihrig)
#26592
* fs:
* remove experimental warning for fs.promises (Anna Henningsen)
#26581
* http:
* makes response.writeHead return the response (Mark S. Everitt)
#25974
* http2:
* makes response.writeHead return the response (Mark S. Everitt)
#25974
* n-api:
* make func argument of napi\_create\_threadsafe\_function optional
(legendecas)
#27791
* mark version 5 N-APIs as stable (Gabriel Schulhof)
#29401
* implement date object (Jarrod Connolly)
#25917
* process:
* add --unhandled-rejections flag (Ruben Bridgewater)
#26599
* stream:
* implement Readable.from async iterator utility (Guy Bedford)
#27660
* make Symbol.asyncIterator support stable (Matteo Collina)
#26989
PR-URL: #29875
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