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 16:43:33 +0200
Message-ID: <CADnb78iav5aWpNLrmKMcYdvoviSgeHfUS-yrSfkVuuKVGDxCbg@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 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

This archive was generated by hypermail 2.3.1 : Friday, 16 October 2015 14:43:57 UTC