On 6/22/06, Karl Guertin <[EMAIL PROTECTED]> wrote: > > On 6/22/06, Bram Vandoren <[EMAIL PROTECTED]> wrote: > > Is Turbogears suitable for > > this kind of application or is it better to use Twisted? > > Turbogears uses CherryPy which dispatches a thread for every > connection rather than doing async io like Twisted. This makes it > unsuitable for handling large numbers of long lived http connections. > If I'm wrong on this, Robert will undoubtedly correct me. ;] > > First Class -- TG 1.1, currently in early stages of development -- > will be WSGI based, which should in theory allow it to run on a > twisted server. I'm not sure if that would be all that's necessary to > get TG to be comet-capable, but it's a possibility for the future.
Right now, TG fires up a thread that updates the visit tracking stuff. Would it be possible to do something similar for Comet stuff? The idea would be that at startup, TG fires up a thread that runs a twised reactor. That reactor would listen on a different port than CP for "Comet" requests. Somehow (possibly a widget?) TG would provide the user to enable Comet-functionality on a page. This would include pulling in the relevant javascript and setting up a hidden iframe to receive messages from the twisted thread. Also, some decorators or similar would be provided to expose functions to the twisted reactor and make them remote callable (browser to server and server to browser). I've been looking at Nevow's athena module (also known as LivePage). Some ideas there, except that it's Mozilla only since it uses XMLHttpRequests instead of iframes for the message passing. See [1] and [2]. Also, since the twisted reactor would listen on a different port, XMLHttpRequests wouldn't work. Then again, perhaps TurboGears and/or CP isn't suited for this. Arnar [1] http://divmod.org/trac/browser/trunk/Nevow/nevow/athena.js [2] http://divmod.org/trac/browser/trunk/Nevow/nevow/athena.py --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

