Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Server push

0 views
Skip to first unread message

marco

unread,
Nov 14, 2009, 6:28:56 AM11/14/09
to
Ciao all,

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

Marco Donizelli

unread,
Nov 14, 2009, 6:49:20 AM11/14/09
to dev-ext...@lists.mozilla.org
"I read around about timer-based XMLHttpRequest push,"

Sorry, I meant "timer-based XMLHttpRequest pull"....

m

2009/11/14 marco <marco.d...@gmail.com>

John J. Barton

unread,
Nov 14, 2009, 12:51:34 PM11/14/09
to

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

Brian McKinney

unread,
Nov 14, 2009, 3:05:39 PM11/14/09
to dev-ext...@lists.mozilla.org
We use long-poll (i.e. issue a request, the server blocks until it has
something, and then we immediately issue a new request) from our
extension via a singleton with great success.

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

Eric Jung

unread,
Nov 14, 2009, 6:18:17 PM11/14/09
to dev-ext...@lists.mozilla.org
On Sat, Nov 14, 2009 at 6:49 AM, Marco Donizelli
<marco.d...@gmail.com>wrote:

> "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

Peter Schmidt

unread,
Nov 14, 2009, 6:32:29 PM11/14/09
to
marco schrieb:

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

marco

unread,
Nov 15, 2009, 5:46:11 PM11/15/09
to
John, Brian, Eric and Peter,
thanks a million for your kind and very helpful replies,
really appreciate.

m

0 new messages