-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add __async: auto decorator
#26019
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
Add __async: auto decorator
#26019
Conversation
src/jsifier.mjs
Outdated
| } | ||
|
|
||
| const isAsyncFunction = LibraryManager.library[symbol + '__async']; | ||
| if (ASYNCIFY && isAsyncFunction == 'auto') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For JSPI, I don't think we even need the handleAsync. Though there still may be some issues with balanced runtimeKeepalivePush runtimeKeepalivePop. Maybe worth a try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think handleAsync is used to keep the runtime alive using runtimeKeepalivePush which I think this currently important. We can look at further simplification are followups perhaps, but for now I'd rather leave the semantics as matching.
b030f31 to
7309c65
Compare
This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out `__async` functions soon and just make this the default.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to #26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
Followup to emscripten-core#26019. I'm not sure about the meaning of the comment here, but `__async: auto` uses `handleAsync` under the hood and it seems to work just fine.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
The only function that remains that still uses `async: true` is `emscripten_fiber_swap`, and this is because it doesn't use handleSleep or handleAsync, so is not a candidate for `async: auto`. Followup to emscripten-core#26019 and emscripten-core#26095.
This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out
__asyncfunctions soon and just make this the default.