DOM: Futures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

DOM: Futures

Anne van Kesteren-4
The Future has arrived:

  http://dom.spec.whatwg.org/#futures

Thanks in particular to the https://github.com/slightlyoff/DOMFuture
project for nailing down all of the details. If someone is interested
in contributing examples the DOM Standard accepts pull requests
https://github.com/whatwg/dom but you can also contact me directly if
you think that would be easier.

(I did a bcc to public-webapps just in case.)


--
http://annevankesteren.nl/

Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

David Bruant-5
<3

Le 28/03/2013 17:04, Anne van Kesteren a écrit :

> The Future has arrived:
>
>    http://dom.spec.whatwg.org/#futures
>
> Thanks in particular to the https://github.com/slightlyoff/DOMFuture
> project for nailing down all of the details. If someone is interested
> in contributing examples the DOM Standard accepts pull requests
> https://github.com/whatwg/dom but you can also contact me directly if
> you think that would be easier.
>
> (I did a bcc to public-webapps just in case.)


Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Glenn Maynard
In reply to this post by Anne van Kesteren-4
On Thu, Mar 28, 2013 at 11:04 AM, Anne van Kesteren <[hidden email]> wrote:
The Future has arrived:

  http://dom.spec.whatwg.org/#futures

Thanks in particular to the https://github.com/slightlyoff/DOMFuture
project for nailing down all of the details. If someone is interested
in contributing examples the DOM Standard accepts pull requests
https://github.com/whatwg/dom but you can also contact me directly if
you think that would be easier.

What's the purpose of this?  We already have DOM Events for "a convenient way to get access to the result of an operation".  I'm confused at this suddenly appearing in the spec with, as far as I've seen, no discussion at all on the www-dom, webapps or whatwg lists.

--
Glenn Maynard

Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Tab Atkins Jr.
In reply to this post by Anne van Kesteren-4
On Thu, Mar 28, 2013 at 9:04 AM, Anne van Kesteren <[hidden email]> wrote:

> The Future has arrived:
>
>   http://dom.spec.whatwg.org/#futures
>
> Thanks in particular to the https://github.com/slightlyoff/DOMFuture
> project for nailing down all of the details. If someone is interested
> in contributing examples the DOM Standard accepts pull requests
> https://github.com/whatwg/dom but you can also contact me directly if
> you think that would be easier.
>
> (I did a bcc to public-webapps just in case.)

I'm very interested in rewriting some of the explanatory text around
this, because right now it's very difficult to figure out what the
exact details and workings of Futures are.  I can handle this through
PRs.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Anne van Kesteren-4
On Thu, Mar 28, 2013 at 9:35 PM, Tab Atkins Jr. <[hidden email]> wrote:
> I'm very interested in rewriting some of the explanatory text around
> this, because right now it's very difficult to figure out what the
> exact details and workings of Futures are.  I can handle this through
> PRs.

Sounds excellent! What's there is just the algorithms and API. What's
needed is an introduction and some explanatory text for other
specifications that wish to use futures. Oh, and domintro boxes that I
will add at some point. I admit though that my strong point is model +
API with a focus on implementations (and tests written for them) that
need to behave identically, not so much explanatory text. I find it
really hard to stay precise, concise, and clear in such text.


--
http://annevankesteren.nl/

Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Jake Verbaten
What are the semantics for the IO a Future does? 

Does it start doing an asynchronous operation immediately?
Does it start doing an asynchronous operation once then or accept or done is called?

Is a future a lazy representation of the asynchronous result?
Or is it simply an object on which you can put glorified event listeners for success & failure?


On Thu, Mar 28, 2013 at 2:49 PM, Anne van Kesteren <[hidden email]> wrote:
On Thu, Mar 28, 2013 at 9:35 PM, Tab Atkins Jr. <[hidden email]> wrote:
> I'm very interested in rewriting some of the explanatory text around
> this, because right now it's very difficult to figure out what the
> exact details and workings of Futures are.  I can handle this through
> PRs.

Sounds excellent! What's there is just the algorithms and API. What's
needed is an introduction and some explanatory text for other
specifications that wish to use futures. Oh, and domintro boxes that I
will add at some point. I admit though that my strong point is model +
API with a focus on implementations (and tests written for them) that
need to behave identically, not so much explanatory text. I find it
really hard to stay precise, concise, and clear in such text.


--
http://annevankesteren.nl/


Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Anne van Kesteren-4
On Thu, Mar 28, 2013 at 10:06 PM, Jake Verbaten <[hidden email]> wrote:
> What are the semantics for the IO a Future does?
>
> Does it start doing an asynchronous operation immediately?
> Does it start doing an asynchronous operation once then or accept or done is
> called?

This is up to the implementation. In theory the operation could
already be running or have been completed once you construct a future.
Often I would expect it to start once you construct one, but the nice
thing is that the feature allows implementations to optimize that in a
non-observable way.


> Is a future a lazy representation of the asynchronous result?
> Or is it simply an object on which you can put glorified event listeners for
> success & failure?

Reading https://github.com/slightlyoff/DOMFuture/blob/master/README.md
might help.


--
http://annevankesteren.nl/

Reply | Threaded
Open this post in threaded view
|

Re: DOM: Futures

Anne van Kesteren-4
In reply to this post by Glenn Maynard
On Thu, Mar 28, 2013 at 7:08 PM, Glenn Maynard <[hidden email]> wrote:
> What's the purpose of this?  We already have DOM Events for "a convenient
> way to get access to the result of an operation".  I'm confused at this
> suddenly appearing in the spec with, as far as I've seen, no discussion at
> all on the www-dom, webapps or whatwg lists.

Events fall short on many things futures are great at. I recommend
reading some of the background material and discussion I pointed to.
It's been mentioned several times on the lists you mention and was
proposed on public-script-coord.

http://www.w3.org/Search/Mail/Public/search?keywords=domfuture


--
http://annevankesteren.nl/