[promises] Difficulties with using constructors and promises together

"Tab Atkins Jr." <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <CAAWBYDDYqyKmbepTkDTzOp1Y00mm=9ad5TQpeY7X45mRKMN8Pw@mail.gmail.com>
When we're trying to construct an object, the right idiom is to use a
constructor, rather than a factory function.  On the other hand, when
we need to return something async, the right idiom is to use a
promise.

What about when we need to construct an object async?

A few examples:
* createImageBitmap()
<http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#images>
* TaskScheduler.add() <http://web-alarms.sysapps.org/#interface-taskscheduler>

These two demonstrate both callback and Future-based ways of dealing
with this async object creation, and both are forced into using
factory functions.

Is this just what we'll have to do?  Whenever an object can only be
created async, we have to add an "Interface.create()" function?  Or is
there a better solution floating around somewhere that I can't see?

~TJ
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.