Re: [hybi] Addressing Minimal Events

Ian Hickson <ian@hixie.ch> Mon, 13 April 2009 19:40 UTC

Return-Path: <ian@hixie.ch>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 4B4063A6CD7 for <hybi@core3.amsl.com>; Mon, 13 Apr 2009 12:40:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.443
X-Spam-Level:
X-Spam-Status: No, score=-3.443 tagged_above=-999 required=5 tests=[AWL=-0.844, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JA87Hqb1mcZU for <hybi@core3.amsl.com>; Mon, 13 Apr 2009 12:40:01 -0700 (PDT)
Received: from looneymail-a3.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 6B9B93A6819 for <hybi@ietf.org>; Mon, 13 Apr 2009 12:40:01 -0700 (PDT)
Received: from hixie.dreamhostps.com (hixie.dreamhost.com [208.113.210.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a3.g.dreamhost.com (Postfix) with ESMTP id 23C3827B96; Mon, 13 Apr 2009 12:41:11 -0700 (PDT)
Date: Mon, 13 Apr 2009 19:41:11 +0000
From: Ian Hickson <ian@hixie.ch>
To: Mark Lentczner <markl@lindenlab.com>
In-Reply-To: <170C0E82-633A-4CA9-B26E-38015BFC7C0D@lindenlab.com>
Message-ID: <Pine.LNX.4.62.0904131938150.10339@hixie.dreamhostps.com>
References: <49DEF171.4080506@mozilla.com> <c5b3a7130904100019ged7ec45o749213482f12c878@mail.gmail.com> <op.usaa24vt64w2qv@anne-van-kesterens-macbook.local> <170C0E82-633A-4CA9-B26E-38015BFC7C0D@lindenlab.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: hybi@ietf.org
Subject: Re: [hybi] Addressing Minimal Events
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Apr 2009 19:40:02 -0000

On Mon, 13 Apr 2009, Mark Lentczner wrote:
> 
> What I'm wondering is: How does one, given a Minimal, Event style 
> protocol, handle when there are two or more widgets on the page that 
> need updates? The home page view on Facebook, for example, has at least 
> four separate areas being live-updated.

The simplest solution is probably to start off a shared worker [1] and 
then have that worker open the WebSocket connection back to the server and 
simply have it broadcast updates to all the scripts that have connected to 
the shared worker.

[1] http://www.whatwg.org/specs/web-workers/current-work/

This would have the benefit of not increasing the number of connections 
even when the user opens more tabs, too.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'