Re: Promise/Future: asynchrony in 'then'

>> Juan already pointed out the "queue a task" language, so this is answered.


> This is far too glib. The spec may very well be wrong on this point. The
> design goal isn't to require a full yeild of the event loop, but instead to
> force async code flow -- that means that resolving and calling back should
> be able to happen at "end of microtask"; the same timing as
> Object.observe() callbacks.

Promises/A says has an open issue on whether callback handlers should be put on the event queue or executed immediately.

Promises/A+ & Promises/B both specify that callbacks may not be invoked in the same turn of the event loop. 
 
According to the harmony:observe doc, it was suggested that "Schedule change events to be delivered asynchronously “at the end of the turn”".

These may all be wrong, but all seem to be hitting at the fact that "in a new turn" is the *easiest* way to force asynchronicity.  Maybe we need to specify that all callbacks must be invoked asynchronously, regardless of which turn in the event loop they occur.

-s

Received on Wednesday, 1 May 2013 16:25:22 UTC