Task Queues as a primitive

The HTML spec speaks a lot about task queues [1] and "spin the event loop" [2], but there are only limited ways for devs to hook into those today. Would be nice if there was some primitive that allowed JS developers to hook into the loop without relying on hacks like setTimeout and MutationObserver. It would also be nice to see what is in those task queues (ordering, etc) and in which order the task queues are processed.  

Thoughts (or does anyone know of related threads else where)? Should we add that to the list of "primitives" we need for the platform? 
 

[1] http://www.whatwg.org/specs/web-apps/current-work/#task-queue
[2] http://www.whatwg.org/specs/web-apps/current-work/#spin-the-event-loop

-- 
Marcos Caceres

Received on Monday, 1 July 2013 15:21:37 UTC