Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd7e4ab

Browse filesBrowse files
tilgovibengl
authored andcommitted
doc: fix async iterable pipeline signal examples
Fix the pipeline examples to show that async generators receive an AbortSignal wrapped in an object. PR-URL: #42258 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 96dc591 commit fd7e4ab
Copy full SHA for fd7e4ab

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2469,7 +2469,7 @@ const fs = require('fs');
24692469
async function run() {
24702470
await pipeline(
24712471
fs.createReadStream('lowercase.txt'),
2472-
async function* (source, signal) {
2472+
async function* (source, { signal }) {
24732473
source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
24742474
for await (const chunk of source) {
24752475
yield await processChunk(chunk, { signal });
@@ -2493,7 +2493,7 @@ const fs = require('fs');
24932493

24942494
async function run() {
24952495
await pipeline(
2496-
async function * (signal) {
2496+
async function* ({ signal }) {
24972497
await someLongRunningfn({ signal });
24982498
yield 'asd';
24992499
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.