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

On Fri, Oct 16, 2015 at 4:20 PM, Adam Bergkvist
<adam.bergkvist@ericsson.com> wrote:
> In the WebRTC 1.0 spec we have some promise-returning methods on a
> stateful object (RTCPeerConnection). I would like guidance on how to
> behave when the instance, on which a method is called, goes into a
> closed state while an async operation is doing its work. When done,
> should the promise be rejected, or should we just leave it pending. Note
> that the script will be informed about the state change through other
> mechanisms.

This is not really enough information to go on. The promise and the
state live in the main thread. The promise operation and the state
change live in some parallel thread (the same?). Fulfilling the
promise and changing the state will both require some kind of message
passing to the main thread for synchronization. If you have detailed
out that processing model there's likely some obvious choices to be
made.


-- 
https://annevankesteren.nl/

Received on Friday, 16 October 2015 14:43:57 UTC