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

From: Adam Bergkvist [mailto:adam.bergkvist@ericsson.com]

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

A few questions that might help guide us:

- Once the instance goes to a closed state, is it possible for the async operation to ever complete successfully?
- Once the instance goes to a closed state, would you say that the async operation has now failed?
- Is the instance going in to a closed state while this async operation is ongoing an "exceptional" condition?
- Is the instance going in to a closed state while this async operation is ongoing the result of author coding error?

Received on Friday, 16 October 2015 17:05:35 UTC