Hacker News new | ask | show | jobs
by azdle 4333 days ago
Sure, I work for Exosite[1].

I'm mostly curious about this because we're working on getting something similar into our API right now (the subscribe part, scripting has been there for awhile now) and I've been thinking a lot about this stuff recently, I've probably been pushing the most out of anyone here.

Did you guys have a reason for going for chunked over long polling though?

[1]http://exosite.com

1 comments

Not exactly sure what you mean by long-polling in this context. Do you mean a client making calls to the API at regular timed intervals to check the status? Or do you mean the server making calls to an endpoint URI when an event occurs?
Basically, it's:

1. Client makes a request, somehow indicating that it wants to do long polling (url, header, etc.).

2. Server receives the request, but does not reply, the socket is left open.

3. An event occurs, then the server finally responds to the initial request with information about the event.

4. Go to 1.

So it's basically polling, except the server just seems to take a really long time to respond.

In the end, both ways are completely valid methods, I was just wondering if there was any particular thing that swayed you either way.