← Back to team overview

launchpad-dev team mailing list archive

Re: disabling longpoll


On 20 February 2012 15:02, Francis J. Lacoste
<francis.lacoste@xxxxxxxxxxxxx> wrote:
> On 12-02-18 05:35 PM, Cruz Bishop wrote:
>> In this case, would it be possible for the client to check how many
>> connections are unused (via, say, JavaScript) and disabling
>> longpoll on new tabs if there's less than X connections left?
> The problem is that the JS security model doesn't let you introspect
> that client-side. A possibility would be to ask the server how many
> longpoll connections it has for the current client.

For Chrome, Opera, and Safari we could use a SharedWorker [1] to serve
as a single exchange - and a single connection - for all longpoll
events from Launchpad for all tabs.

It would need some changes in the way we associate pages with events,
but would probably be a much better solution all round.

And, until support for SharedWorker arrives for IE and Firefox, we
should not support those browsers. Put another way, we should only
support browsers where window.SharedWorker !== undefined.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#sharedworker