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

Streaming JSON to express #47

Closed
darkenspirit opened this issue Aug 11, 2014 · 2 comments
Closed

Streaming JSON to express #47

darkenspirit opened this issue Aug 11, 2014 · 2 comments

Comments

@darkenspirit
Copy link

I have oboe pulling out the objects I want from the readstream but I dont know how to pipe it back to res?

app.get('/foo', function(req, res) {
var rstream = oboe(fs.createReadStream("./test");
rstream.node( "{}", function(data) {
if ( data.test != undefined ) {
>>>> now what?

rstream has no method pipe so I cant simple
rstream.pipe(res) at this point.

If i try the example with streaming HTML with JSON service, I get an error saying no engine or extension provided when creating a new view.

I am really not sure how to proceed here

@darkenspirit
Copy link
Author

I did a current workaround where it just pushes the object to a new array and on .done event I res the array.

This hits the memory pretty hard but I dont know what else to do to get these objects out.

also how do I drain the stream after it has checked each object? This is the biggest memory drain because I think the .done response has the entire object?

@foundling
Copy link

@darkenspirit did you ever figure this out? I'm also curious about piping to res instead of building all of the data in memory.

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

2 participants