W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2009

Re: ISSUE-3 (async-style): Asynchrnonous calls style [APIs General]

From: Robin Berjon <robin@berjon.com>
Date: Tue, 1 Sep 2009 11:57:34 +0200
Cc: "Device APIs and Policy Working Group WG" <public-device-apis@w3.org>
Message-Id: <48B740EF-0339-4042-B86A-0847AF592D09@berjon.com>
To: Arve Bersvendsen <arveb@opera.com>
On Aug 31, 2009, at 21:12 , Arve Bersvendsen wrote:
> On Tue, 25 Aug 2009 15:08:36 +0200, Device APIs and Policy Working  
> Group Issue Tracker <sysbot+tracker@w3.org> wrote:
>> ISSUE-3 (async-style): Asynchrnonous calls style [APIs  General]
>>
>> http://www.w3.org/2009/dap/track/issues/3
>>
>> Raised by: Robin Berjon
>> On product: APIs  General
>>
>> We need to pick a common style for asynchronous calls (handles for  
>> cancellation, DOM Events or not, etc.).
>
> I'll ask the same question I did for ISSUE-2: Do we really? Whether  
> something is a callback or event, or is cancellable or not would  
> depend on the particular use-case, no?

I'm fine with that if that's the general feeling of the WG, but at the  
very least rough guidelines about when to use events or callbacks  
could help. The WebApps WG recently tailspinned into several weeks of  
not-always-friendly discussion about events versus callbacks  I'd  
rather we avoided that.

Here's a quick proposal, feel free to add to or subtract from it:

  - Every asynchronous call should be cancellable, unless there are  
overriding technical issues that make the action irreversible (e.g.  
window.dropPiano()).

  - Events will be used whenever there is a solid use case indicating  
decentralised observation or the need for simulating the action  
(synthetic events); otherwise callbacks will be used.

-- 
Robin Berjon - http://berjon.com/
Received on Tuesday, 1 September 2009 09:58:16 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:38 UTC