W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2013

Re: Futures in WebRTC

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Tue, 4 Jun 2013 15:01:35 +0200
Message-ID: <51ADE52F.9090307@ericsson.com>
To: Anne van Kesteren <annevk@annevk.nl>
CC: "public-media-capture@w3.org" <public-media-capture@w3.org>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On 2013-05-28 11:35, Anne van Kesteren wrote:
> I was asked to email a brief overview here in preparation of the call next week.
>
> == Introduction ==
>
> A future basically represents a value that may not yet have been
> computed. Since we lacked that concept thus far we've been emulating
> it with events (ondone/onerror) and callbacks (successCallback,
> failureCallback) in a somewhat mixed and adhoc fashion.
>
> Also, by making this a new type we can do interesting things with that
> type such as grouping. See http://dom.spec.whatwg.org/#futures for
> more information.
>
> == Revised WebRTC IDL ==
>
> For the current features of WebRTC this would mean the IDL comes to
> look like this (I grouped the features from various drafts together
> here):
>
> * Future takePhoto();
> * Future getUserMedia(optional MediaStreamConstraints constraints);
> * Future createOffer(optional MediaConstraints constraints);
> * Future createAnswer(optional MediaConstraints constraints);
> * Future setLocalDescription(RTCSessionDescription description);
> * Future setRemoteDescription(RTCSessionDescription description);
> * Future getStats(MediaStreamTrack? selector);
>
> One bonus seems to be that you no longer have the confusion of where
> the callbacks go relative to the other arguments.
>
> == Open issues ==
>
> Futures are not completely baked yet, but the basic idea of a value
> that may not yet have been computed and either turns out to be an
> error of sorts on asynchronous inspection or a real value has wide
> consensus.

Anne, can you comment on the preferred behavior when an object returns a 
Future but enters the closed state (where it basically is useless and 
throws InvalidState exceptions when interacted with) before the Future 
is resolved. Should the Future be left in the pending state or should it 
be rejected?

/Adam
Received on Tuesday, 4 June 2013 13:02:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:33 UTC