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

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.)


-- 
https://annevankesteren.nl/

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