New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide microtask enqueue api #13433
Comments
Long-term, I think Dart should piggyback off of DOM promises, though it looks like those are not in yet. There has been discussion of scheduling nuances between MutationObservers and promises (such as promises queue and mutation observers queues would be separate but flushed in sequence). Short-term, dart:html is currently piggy-backing on MutationObserver for setImmediate in dart:html, the code is fairly minimal and performant (a div and a mutation observer, then we just toggle a property on the div every time it needs to be scheduled)- We should be able to follow the same pattern for dart2js on downlevel Chrome and Firefox as well (Firefox should be getting DOM promises in the near future as well). |
I think it is ok to piggyback on MutationObservers for now, but we need to discuss how to do that. Since the way microtasks are enqueued depends on the embedder we can't just import dart:html and use that everywhere. It needs to be the embedder that sets a function (or similar) that we then can use. |
Note, we do that (setting a function) to forward print in dart:core to console.log in dart:html. E.g., Dartium ensures that a private variable in dart:core is set to console.log before executing user code. (This also came up in Soren's URI CL. We might want refactor all these forwarding points into a class or singleton that the embedder provides.) |
Anders - looks like this is covered by your CLs. Can you please reassign to me if there is anything else? Set owner to @skabet. |
[+iposva] cc @iposva-google. |
Yep, will update once landed. Added Started label. |
Anders, is there more stuff to be done here? Removed Priority-Unassigned label. |
Yes, there may already be a Microtask-queue we could re-use. I misread the existing code, and will look into a fix next week. |
Turns out it was removed, in favor of the new implementation. Dartium is working now. Added Fixed label. |
dart:async needs the ability to schedule a microtask when running in Dartium.
The current Microtask code in Blink:
http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Microtask.cpp?revision=152982
appears to drain the MutationObserver queue and CustomElement callback queue.
To support the general functionality dart:async, we could:
thoughts?
The text was updated successfully, but these errors were encountered: