Hello pyro9219, On 2/6/07, Richard Clark <[EMAIL PROTECTED]> wrote: > > Near-realtime is fine. You can use an xmlhttp connection to wait for > information to be available from the server side, and info from the > client side is easily sent. It's not really a turbogears problem as > much as a javascript one. The rest is just support (ie, JSON which > Turbogears supports).
I have done this with good success (i.e. establishing an xmlhttp connection and just waiting until the server responds) - google "comet" for more information. It's not that hard on the js side, especially if you utilize MochiKit.Signal - I can send you some code if you like. The problem is that when doing this with a threaded webserver like CherryPy (which is what TG runs on) each waiting client will tie up a thread for no reason. This doesn't scale very well. One idea that I haven't tried out is to have something like Twisted handle those connections asynchronously in a single thread - which would be much easier on resources. Apache 2.2 has a new mpm module specially built for this called "event". > It's more than quick enough for snappy information, the thing to > beware of is the load, ie if you're trying to send a full stockmarket > feed then you have to be very very careful about your message design. > JSON is a bit too buky for that kind of thing unless they have a very > fast link - you want a custom client instead so you can be clever. In my experience with ajax/json/xmlhttp and all that stuff, things are usually faster and lighter than you expect. I say just give it a try and measure performance - if you're not happy then optimize. Arnar --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

