1 Jun 2009 01:59
[Lift] Re: JavaScript interface to Comet
Thanks for pointing me into the right direction. I've created a simple example (see attachment). In my example, the user can drag a div around the screen. Every time the div moves, the browser sends a json object with the x and y coordinates to the comet steam. Unfortunately I've ran into a couple of usability and performance problems. Assume the following set up: two browses are open (browser A and B) are all listening to comet stream K. Comet stream K broadcasts commands that update the position of a div. It seems that whenever browser A notifies comet stream K about an update to the div's position, stream K broadcasts the message to all its listeners, including browser A. In other words, browser A essentially hears its own echo. For the user of browser A, this causes the div to constantly jump between where the user actually dragged it and the position that comet stream K is currently broadcasting. Also there does not seem to be any throttling mechanism for client-side comet calls. In my attached example, even a very simple drag action creates dozens of ajax calls at once. Firefox does not handle this well. I'd greatly appreciate any tips or suggestions. Thanks, Xavi P.S. Random question: Is there a CometActor instance for every browser(Continue reading)
RSS Feed