emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Add emscripten_queue_microtask() API

Open juj opened this issue 1 month ago • 2 comments

Add emscripten_queue_microtask() API to enable use case described in this thread: https://github.com/emscripten-core/emscripten/pull/25670#discussion_r2469827161.

juj avatar Nov 07 '25 11:11 juj

I had a version of this API in https://github.com/emscripten-core/emscripten/pull/24481... but sure how it compares

sbc100 avatar Nov 07 '25 17:11 sbc100

I had a version of this API in #24481... but sure how it compares

Maybe just copy the version I had in that PR? Should probably live in libeventloop.js too.

I was recently chatting to someone on chrome team about why we this API event exists given that its pretty much indistinguishable from Promise.resolve().then(X) which predates queueMicrotask and is available everywhere.

sbc100 avatar Nov 07 '25 17:11 sbc100