[Mongrel] mongrel and comet "implementation"
zedshaw at zedshaw.com
Thu Aug 10 11:36:04 EDT 2006
On Wed, 2006-08-09 at 23:45 -0700, Topher Cyll wrote:
> Hey folks,
> to receive events without AJAX polling) support to Mongrel. More info
> about Comet here:
> I sort of got it working. My code is available at:
Pretty cool. So you're using a chunked encoding to stream out the new
data. One thing:
You don't need the ";". That's only required if you add parameters to
the chunked encoding header. Just give the size (in hex).
I've contemplated doing chunked encodings for Mongrel, but I still have
the problem that frameworks do their headers and body out of order, so
it gets ugly (and also most proxies don't grok chunked encoding).
> The fly in the ointment is that until a Comet request finishes, that
> URL mount point stops responding. I assume this is because of how
> thread management happens in Mongrel. Leaving the request unfinished
> like I do is probably uncool.
That shouldn't happen. Mongrel isn't locking or anything when running,
so you should be able to server multiple requests. I'll take a look at
> One way to sort of work around the problem is to use a dispatcher that
> registers a new handler at a unique URL for each Comet user. You can
> see that both the main page and:
> work simultaneous. And neither affects other mounted handlers, so you
> can also access:
> Anyways, I'm not really doing anything with this code and I'm sure it
> has problems, but I thought I'd put it out there in case anyone else
> wanted to play around with Mongrel and Comet.
And no idea why that would work. Like I said, no locking in mongrel but
I'll look at it.
Cool job. If you get a chance to work this further keep sending me
feedback and code.
Zed A. Shaw
http://www.railsmachine.com/ -- Need Mongrel support?
More information about the Mongrel-users