W3C home > Mailing lists > Public > public-media-capture@w3.org > April 2013

Re: VideoStreamTrack: takePhoto()

From: Harald Alvestrand <harald@alvestrand.no>
Date: Tue, 09 Apr 2013 11:48:58 +0200
Message-ID: <5163E40A.8050201@alvestrand.no>
To: public-media-capture@w3.org
On 04/09/2013 10:13 AM, Anne van Kesteren wrote:
> On Tue, Apr 9, 2013 at 8:21 AM, Harald Alvestrand <harald@alvestrand.no> wrote:
>> It seems to me that futures (what I understand of them) are easily able to
>> implement the "one query, one result" semantic of a callback-based API.
> Yes, they're good at representing something that will become a value
> at some point in time.
>> I think event-based machinery is appropriate when the number of things that
>> can happen is indeterminate (0, 1 or many); onaddstream is a typical
>> example.
>> Is there a version of futures that permits capturing this semantic too?
> No, you would just use events for that.

Thanks for the clarification!

>   takePhoto() however uses
> events for a semantic getMediaStream() uses callbacks for. Why do you
> keep missing this particular comment?
I agree that this is inconsistent and needs changing.
It was a less obvious inconsistency a couple of versions (weeks) ago, 
where the event could fire multiple times. This particular spec is new.

I was focusing on the issue of using Futures or not, since that seemed 
to be the controversial (to me) part of your comment.
Received on Tuesday, 9 April 2013 09:49:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:16 UTC