Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-14 Thread David Rajchenbach-Teller
I also think that this makes sense. Can we already start thinking about countermeasures, though? It looks to me that catching a long-running/infinite microtask loop is much easier to detect and interrupt than a long-running sequential loop. However, if we wish to pause a page with such a

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-14 Thread Anne van Kesteren
On Thu, Jan 14, 2016 at 10:44 AM, David Rajchenbach-Teller wrote: > I also think that this makes sense. Can we already start thinking about > countermeasures, though? Whatever we do for while(true) we should reuse here. There's no observable difference to the user. (And as

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-14 Thread Boris Zbarsky
On 1/14/16 4:44 AM, David Rajchenbach-Teller wrote: However, if we wish to pause a page with such a microtask loop to display some UX, trigger a breakpoint or even to leave some CPU to other pages in the same process, is there anything specific we need to do to guarantee that no network/user

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-14 Thread Boris Zbarsky
On 1/14/16 6:27 AM, Anne van Kesteren wrote: Whatever we do for while(true) we should reuse here. There's no observable difference to the user. (And as stated this can already happen with promises and mutation observers.) I dunno what the situation is right now with mutation observers, but for

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-13 Thread Kyle Huey
In principle, I don't see any reason not to do this. - Kyle On Wed, Jan 13, 2016 at 1:59 PM, Boris Zbarsky wrote: > Please see https://github.com/whatwg/html/issues/512 > > Right now this is in the "does anyone have an objection to the basic > idea?" stage. So if someone

Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-13 Thread Boris Zbarsky
Please see https://github.com/whatwg/html/issues/512 Right now this is in the "does anyone have an objection to the basic idea?" stage. So if someone does, please speak up! I've already noted a possible concern about abuse, but Promise and MutationObserver kinda allow that already; it just

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-13 Thread Ehsan Akhgari
I think this makes sense. On 2016-01-13 4:59 PM, Boris Zbarsky wrote: Please see https://github.com/whatwg/html/issues/512 Right now this is in the "does anyone have an objection to the basic idea?" stage. So if someone does, please speak up! I've already noted a possible concern about

Re: Feedback needed on proposal to add a web primitive for queuing microtasks

2016-01-13 Thread Jonas Sicking
Sounds good to me as well. As long as it's very clearly defined that this doesn't return to the event loop and so UI events, timers, network events, etc MUST NOT be processed between the tasks under any circumstances. I.e. something like: function spinner() { window.enqueueMicrotask(spinner) }