Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does 'readable' event really work? #22

Closed
krlicmuhamed opened this issue Aug 13, 2016 · 0 comments
Closed

How does 'readable' event really work? #22

krlicmuhamed opened this issue Aug 13, 2016 · 0 comments

Comments

@krlicmuhamed
Copy link

krlicmuhamed commented Aug 13, 2016

What happens when parsing the buffer fails? (ex. sudden cut off, random data being inserted)
How am I going to manage that?

What does this piece of code do?

parser.on("readable", function() {
  var e;
  while (e = parser.read()) {
    console.log(JSON.stringify(e, null, 2));
  }
});

I think that loop is used for checking buffer read completion, am I right?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant