in reply to Re^2: Perl modules for Comet ?
in thread Perl modules for Comet ?

As far as I've been able to find out since you posted your OP, there is no real standard for doing all this. I guess you should be able to just flush the output buffer whenever you have a chunk of data ready and let the client-side code figure out how to break up the stream in ready chunks.

I do know that relying on multi-part bodies alone (without client-side code) does not work as well as you'd hope, and I suspect using multi-part bodies will be slightly more work to interpret by your ajax code (if they work at all) than a custom (simpler) format.

update: if you want to do this seriously (i.e. multiple events, many clients) with perl, you probably need a special light-weight server for the event streams, if only because having a few hundred apache processes will eat your memory.

Replies are listed 'Best First'.
Re^4: Perl modules for Comet ?
by renodino (Curate) on Feb 11, 2007 at 00:07 UTC
    ...there is no real standard for doing all this.

    I'm discovering the same. Similar to its namesake cleanser, its very green, and a bit abrasive ;^)

    ...you probably need a special light-weight server for the event streams...

    Yes, ergo HTTP::Daemon::Threaded (tho some may contend its heavier than Apache). However, my target is more like 20-100 concurrent users, rather than thousands. Think "application appliance", not Google scale.

    Alas, HTTP::Daemon::Threaded currently relies heavily on HTTP::Request/Response, and the latter doesn't adapt well to the "Service Stream" concept. So I'm thinking a subclass of HTTP::Response that adds a "flush" capability may be useful.


    Perl Contrarian & SQL fanboy