Re: Future statics

Hi Anne,

The example code in 4.1 references "Future.when()" but I don't see any definition for this method.

For Future.every() and Future.some(), I did not see anything requiring the order of the values array supplied to the callbacks should match the order of the futures supplied.  These methods will be harder to use without this requirement.

A fourth static would be nice that behaves similar to Task.WhenAll() in the .Net Framework (1)

Future.???() - Almost like 'every' except that it waits for all futures to complete and if any were rejected then rejects the future with an array of the rejection values.


(1) http://msdn.microsoft.com/en-us/library/hh194874.aspx

 
--
Brandon


________________________________
 From: Anne van Kesteren <annevk@annevk.nl>
To: "www-dom@w3.org" <www-dom@w3.org> 
Sent: Friday, April 5, 2013 11:18 AM
Subject: Future statics
 
I added a short introduction:
http://dom.spec.whatwg.org/#introduction-to-the-future Hopefully this
gives people an idea of what futures can be used for and why they are
useful.

I also these three static methods:

* Future.any() - returns a Future which completes (either accepted or
rejected) when any future passed completes.
* Future.every() - returns a Future which completes when all futures
passed complete or any of them reject.
* Future.some() - returns a Future which completes when any future
passed is accepted or all of them reject.


--
http://annevankesteren.nl/

Received on Friday, 5 April 2013 16:56:55 UTC