Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

fix incomplete result for large data #3

Merged
merged 1 commit into from Jan 26, 2012
Merged

Conversation

qiao
Copy link
Contributor

@qiao qiao commented Jan 26, 2012

In your original code, the callback is called as soon as the data event is emitted.

pyg.stdout.on('data', function(data) {
  callback(data.toString());
});

This works only when the size output is small. For large output, the data event will be emitted multiple times and each time there's a partial chunk arriving. Therefore, your original approach will produce incomplete result.

pksunkara added a commit that referenced this pull request Jan 26, 2012
fix incomplete result for large data
@pksunkara pksunkara merged commit a31220a into sunkarapk:master Jan 26, 2012
@pksunkara
Copy link
Contributor

Thanks man, Do you want me to publish this?

@qiao
Copy link
Contributor Author

qiao commented Jan 26, 2012

Yes, I have two projects depending on this module :)

@pksunkara
Copy link
Contributor

Done. :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants