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

Doing something wrong? oboe not reacting to streaming data #34

Closed
tomorgan opened this issue Mar 13, 2014 · 4 comments
Closed

Doing something wrong? oboe not reacting to streaming data #34

tomorgan opened this issue Mar 13, 2014 · 4 comments

Comments

@tomorgan
Copy link

I have this JS on my page:

oboe(requestUri)
.node('*', function( Thing ){
alert('data!');
})
.fail(function() {
alert('problems');
});
});

The requestUri returns an open connection (which never closes) and sends JSON. Here's an example of what it would send:

[{"Attribute":"att1","ID":"test1@test.com","Value":"value1"},{"Attribute":"att2","ID":"test2@test.com","Value":"value2\r\n"}]

It'll send a series of these, as things change. Each time it sends a [ ] containing 1 or more { } (the example shows 2), followed by a line break. Is all that OK for Oboe?

(The \r\n is in the data I'm using - I just noticed it but don't think it would cause a problem?)

I'm using Chrome. Using Dev Tools and Fiddler, I see the initial OPTIONS call (in fact, I had to code the response for it as I didn't have one!), then the GET being made. The data is returned (I've tested using a console app), but Oboe doesn't show anything. No errors in Console window...just nothing.

Am I wrong in trying to use Oboe for streaming HTTP data, or have I missed something?

Thanks for any help here :)

-tom

@jimhigson
Copy link
Owner

It looks like you are using it right. Your assumptions are correct - Oboe doesn't care about object/array etc ('*' should match either type). Newlines, so long as the JSON remains valid, should be ignored.

That you are using CORS shouldn't have any impact either, at least in Chrome.

All I can think of right now: is your stream gzipped? Perhaps the deflate compressor is holding back transmitting until it gets a certain size of buffer filled. Under Node.js/zlib you can set it to flush like this:

zlib.createGzip({
   flush: zlib.Z_SYNC_FLUSH
})

The integration tests for streamability with CORS are passing against Chrome so I don't think there is a bug in the library.

@ooxi
Copy link
Contributor

ooxi commented Mar 13, 2014

How big is the response? Could you set up a testcase somewhere?

@ooxi
Copy link
Contributor

ooxi commented May 6, 2014

Since no feedback was provided for several months this issue should be closed (can be reopened as soon as feedback is available @tomorgan)

@jimhigson
Copy link
Owner

Yes, quite agree. I need to tidy up here and there in the issues section - @ooxi thanks for pointing this out. @tomorgan will be happy to investigate when more info can be provided.

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

3 participants