Explain a bit more how longpolling works

(imported from commit 26c4792f097d748edc725b4528c4d5904efd03c7)
This commit is contained in:
Keegan McAllister 2012-11-28 00:17:02 -05:00
parent ca1b1b2974
commit 30933a9639
1 changed files with 6 additions and 1 deletions

View File

@ -449,7 +449,12 @@ def get_updates_backend(request, user_profile, handler, client_id,
send_with_safety_check(resp, handler, **kwargs)
return
# Now we're in long-polling mode
# Enter long-polling mode.
#
# Instead of responding to the client right away, leave our connection open
# and return to the Tornado main loop. One of the notify_* views will
# eventually invoke one of these callbacks, which will send the delayed
# response.
def cb(**cb_kwargs):
if handler.request.connection.stream.closed():