Add __async: auto decorator#26019
Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom Jan 13, 2026
Merged
Conversation
brendandahl
reviewed
Dec 30, 2025
| } | ||
|
|
||
| const isAsyncFunction = LibraryManager.library[symbol + '__async']; | ||
| if (ASYNCIFY && isAsyncFunction == 'auto') { |
Collaborator
There was a problem hiding this comment.
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?
Collaborator
Author
There was a problem hiding this comment.
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
brendandahl
approved these changes
Jan 5, 2026
This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out `__async` functions soon and just make this the default.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 14, 2026
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.
sbc100
added a commit
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 15, 2026
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.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Jan 16, 2026
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.
inolen
pushed a commit
to inolen/emscripten
that referenced
this pull request
Feb 13, 2026
This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out `__async` functions soon and just make this the default.
inolen
pushed a commit
to inolen/emscripten
that referenced
this pull request
Feb 13, 2026
Followup to emscripten-core#26019 and emscripten-core#26095. The old comment here is, I believe, no longer valid now that emscripten-core#26095 has landed.
inolen
pushed a commit
to inolen/emscripten
that referenced
this pull request
Feb 13, 2026
…ipten-core#26117) 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out
__asyncfunctions soon and just make this the default.