Skip to content

Commit

Permalink
doc: add a note about possible missing lines to readline.asyncIterator
Browse files Browse the repository at this point in the history
Fixes: #33463

PR-URL: #34675
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
mikhalev-im authored and Trott committed Aug 29, 2020
1 parent c2996ce commit 33eda80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ async function processLineByLine() {
}
```

`readline.createInterface()` will start to consume the input stream once
invoked. Having asynchronous operations between interface creation and
asynchronous iteration may result in missed lines.

### `rl.line`
<!-- YAML
added: v0.1.98
Expand Down

1 comment on commit 33eda80

@jfriend00
Copy link

@jfriend00 jfriend00 commented on 33eda80 Aug 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, there is no intent to ever actually "fix" this. You're just going to document it as is and leave it that way forever? So, no asynchronous operations are permitted between creating the interface and consuming the async iterator to read the lines? What if you're trying to use this along with some other asynchronous stuff together? That's just a busted implementation IMO. Documenting the existing behavior is OK for a stop-gap, but not really OK for just sweeping the issue under the rug forever.

Please sign in to comment.