top | item 8180238

(no title)

jheising | 11 years ago

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?

discuss

order

azdle|11 years ago

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.