-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
json parser buffer pipe requests #152
Comments
woah hmm, any idea how big the average response is? You can opt-out of buffering with |
I solved using a noop custom parser. buffer(false) is not working, that's the problem. The sample method of the Streaming API send ~1MB data per second so res.text grows at the same level. Again, I solved for the library using .parse(function(){}) but .buffer(false) seems to fail on this situation, I think is an edge case (I'm receiving json data but the connection will persist "forever") but we'll have more cases like this in the near future. |
hmm interesting, I just remembered that I set this already in .pipe(): https://github.com/visionmedia/superagent/blob/master/lib/node/index.js#L383, if it's not working there's definitely a bug, I'll label this issue and check it out later |
I tried using .buffer(false) and .pipe() (and both together), none of this work. I think the problem is with the response type signature. |
Closing this old issue. If something similar comes up we can revisit. The pipe logic is less than ideal at the moment anyway. |
I'm using superagent for https://github.com/danzajdband/Tuiter
When using a stream method (like tuiter#sample) I'm using the superagent pipe method. Because the response content-type is json (I think that's the reason) the request object is buffering the stream inside res.text.
This is critical for my lib because this buffer is increasing apps memory usage in ~ 1.5MB / sec.
Do you think that's the reason? Is a Superagent issue or am I doing something wrong?
The text was updated successfully, but these errors were encountered: