On Monday 07 January 2008, Ariel Flesler wrote:
> How is that the client can listen for responses of the server? it's an
> XHR connection that remains opened ?

there are a couple transports availble in the dojox.cometd client, long 
polling being the default. subscribe() would issue a command to the server 
(ch: /cometd/meta) to alert the server it wants messages published on some 
topic.  when something comes to the server
via someone's publish(), anyone subscribed to that topic() gets that data.

for instance, I did a magnet "demo", is was basically:

connect(onDragStart) -> publish("/magnet/moving",{ node: magnetId });
connect(onDragEnd) -> publish("/magnet/done",{ 
        coords:$("magnet").dimensions(),
               magnet: magnetId
});
subscribe("/magnet/done",function(o){
        var x = o.data.x +"px";
        var y = o.data.x +"px";
                $(o.data.magnet).css({ top: y, left: x });
});



>
> Ariel Flesler
>
> On 6 ene, 21:30, Peter E Higgins <[EMAIL PROTECTED]> wrote:
> > For whatever reason the "magnet" post didn't get pushed to my client, but
> > I wanted to chime in.
> >
> > fwiw, I have been considering porting the dojox.cometd client to
> > jQuery-plugin-like code.
> >
> > but as far as I know, the only "real" javascript implementation of comet
> > client is the dojo 1.x one.  DWR has a java client as well, which is cool
> > at a glance, but I've not had any chance to play with it.
> >
> > i use twistd comet server and dojox.cometd a lot. It love it. and the API
> > is very simple, the jQuery would look something like:
> >
> > $.cometd.init(url);
> > $.cometd.publish("/some/topic",{ some:"object" });
> > $.cometd.subscribe("/some/topic",function(obj){
> >    console.log(obj.data); // [object some:object]
> >
> > });
> >
> > no ETA, I'm really just playing around with it. Big fan of comet though
> > personally, would love to see it adopted in the various toolkits.
> >
> > Regards,
> > Peter Higgins
> >
> > On Tuesday 01 January 2008, Eridius wrote:
> > > This might or might not be what your looking for but if you want to
> > > keep pushing new content to a page you could use the JHeartbeat plugin
> > >
> > >http://www.jasons-toolbox.com/JHeartbeat/
> > >
> > > coughlinsmyalias wrote:
> > > > Hey all, I am wondering is it possible with jQuery or any other
> > > > plugin to have say real time results on a page. To do say see what
> > > > other changes are being made as you are on the screen?
> > > >
> > > > Or any with a tad bit delay of a couple of seconds?
> > > >
> > > > Thanks!
> > > > Ryan- Ocultar texto de la cita -
> >
> > - Mostrar texto de la cita -


Reply via email to