Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Holing a connection open for long
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Manu J  
View profile  
 More options May 2 2012, 2:34 am
From: Manu J <manu.1...@gmail.com>
Date: Wed, 2 May 2012 12:04:04 +0530
Local: Wed, May 2 2012 2:34 am
Subject: Re: [goliath] Holing a connection open for long

On Wed, May 2, 2012 at 11:47 AM, Ilya Grigorik <igrigo...@gmail.com> wrote:
> Thanks. I think I will use that.

>> I'm curious though. What is the recommended way to handle Ajax long
>> polling in Goliath?

> Return "streaming response" constant in response_env, and then hook up
> some event emitter to your env.stream_send function, in which you can also
> call connection close. Pretty simple. :-)

Like this? https://gist.github.com/9a2d05804eb6a321ad26

What are the advantages over just looping over with a EM::Synchrony sleep
inside the loop ? One advantage is that it is easy to keep the connection
alive by emitting a response frequently.

--
Manu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.