badeend requested wasmtime-core-reviewers for a review on PR #9091.
badeend requested pchickey for a review on PR #9091.
badeend opened PR #9091 from badeend:async-drop
to bytecodealliance:main
:
Add the ability to generate async drop methods for resources.
In the component model,
resource.drop
is a canonical built-in without a proper name. So I invented a custom naming scheme for the component bindgen config. I went with:"[drop]{resource-name}"
where{resource-name}
is the name as defined in WIT. e.g."[drop]input-stream"
.This shouldn't conflict with anything existing in the wild as WIT identifiers are not allowed to contain square brackets.
To the reviewer: please double check
resource_async
. I'm not familiar with this part of the codebase.
Spawned off from https://github.com/bytecodealliance/wasmtime/issues/9058. This change is a prerequisite for a potential solution of that issue, but seems useful enough on its own.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
badeend updated PR #9091.
badeend updated PR #9091.
alexcrichton submitted PR review:
Everything looks good to me, thanks! Would you be up for adding a test for this as well?
badeend commented on PR #9091:
If you're looking for something to test this feature in isolation I'd be glad to add a test for it, but could you point me towards where the component model tests live currently? I tried looking for them in the usual places but couldn't find them.
If all you're after is that this is tested _somehow_ and don't care about the test being in isolation or not, I've got a follow-up PR planned for https://github.com/bytecodealliance/wasmtime/issues/9058 that will be using this feature. So it will be tested indirectly through that.
alexcrichton commented on PR #9091:
Yes I think that this would be good to have a dedicated test for just this. Component-model API tests live at https://github.com/bytecodealliance/wasmtime/tree/main/tests/all/component_model and https://github.com/bytecodealliance/wasmtime/blob/main/tests/all/component_model/async.rs has some examples of doing async things
badeend updated PR #9091.
badeend commented on PR #9091:
Check!
alexcrichton submitted PR review.
alexcrichton merged PR #9091.
Last updated: Dec 23 2024 at 12:05 UTC