W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2015

Re: Need guidance on promise-returning methods on a stateful object

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 16 Oct 2015 19:13:20 +0200
Message-ID: <CADnb78jxjZJe2G+ttAOzby8vK_UPag=rGHzQmoV21iD9XxvWgw@mail.gmail.com>
To: Adam Bergkvist <adam.bergkvist@ericsson.com>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
On Fri, Oct 16, 2015 at 6:55 PM, Adam Bergkvist
<adam.bergkvist@ericsson.com> wrote:
> Here's a simplified description of the algorithm. I hope it clarifies
> where things live.
> 1. Let p be a new promise.
> 2. In paralell, do 'install configuration'.
>    1. If 'install configuration' completes successfully, queue a task to
> run the following steps:
>      1. (possibly check for closed state, reject p and abort?)
>      2. Resolve p with undefined.
> 3. Return p.
> So while the 'install configuration' processing is going on in some
> other thread (not main), the instance might go to the closed state. When
> that happens, you can't really do anything else with the instance
> besides reading some attributes. So when this happens, should we reject
> all pending promises, or just leave them be?

In the abstract, what I don't understand is why the state transition
to closed wouldn't terminate any existing algorithms. (You didn't
really clarify on how the state transition happens and where that
change process lives.)

Received on Friday, 16 October 2015 17:13:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC