can anybody be so kind to point me in the right direction
on how to implement a server push ("Comet programming")
in a Firefox extension? Basically, I need to implement a
widget which gets frequent data updates from a server,
which in turn trigger UI updates.
I read around about timer-based XMLHttpRequest push,
or XMLHttpRequest long polling, or XMLHttpRequest
multipart/x-mixed-replace. Is there a "best approach"
among all the solutions?
Thanks in advance.
m
Sorry, I meant "timer-based XMLHttpRequest pull"....
m
2009/11/14 marco <marco.d...@gmail.com>
I don't know what those other things are, but we've had good luck with
just issuing a request immediately after we receive a response. The
server replies when it has something new. This does not scale, but other
than that it's fine.
jjb
The scaling aspect depends entirely on how your back-end is setup.
Cheers,
Brian
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
> "I read around about timer-based XMLHttpRequest push,"
>
> Sorry, I meant "timer-based XMLHttpRequest pull"....
>
> m
>
>
You could also open a socket between the server and your extension,
publishing new data to the client when it's available. That's the basic idea
beyond comet, and sockets are natively supported in extensions. This
solution probably doesn't scale well. Solaris, for instance, used to have a
max 1024 open sockets at once (no longer, but you get my point I
hope--sockets are expensive).
Eric
I use dojo/comet with my own host environment to run it inside a
javascript code module as a global singleton and jetty on the back-end.
petschm
m