pchickey opened PR #5055 from pch/component_model_async
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
pchickey updated PR #5055 from pch/component_model_async
to main
.
pchickey updated PR #5055 from pch/component_model_async
to main
.
pchickey edited PR #5055 from pch/component_model_async
to main
:
Based on #5065.
This PR adds the async suite of variations on
Linker::wrap_func
,Func::call
,TypedFunc::call
, and the variousinstantiate
functions, for use in async Rust contexts.This ends up being pretty simple: all of the async store machinery from core wasmtime is straightforward to reuse here.
I created a new test suite at
tests/all/component_model/async.rs
to smoke test the new functionality.
pchickey updated PR #5055 from pch/component_model_async
to main
.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
One day in the future it might be best to conditionally do the fiber business here since many functions might not have a
post_return
in which case going through all this for a stack is largely overkill. Put another way the stack is only needed here for thecrate::Func::call_unchecked_raw
call, but this is an optimization we can deal with later.
alexcrichton created PR review comment:
You can simplify this a bit with:
(component (import "i" (func $f)) (core module $m (import "" "" (func $i)) (func (export "thunk") call $i) ) (core func $f (canon lower (func $f))) (core instance $i (instantiate $m (with "" (instance (export "" (func $f)) )) )) (func (export "thunk") (canon lift (core func $i "thunk")) ) )
pchickey updated PR #5055 from pch/component_model_async
to main
.
pchickey submitted PR review.
pchickey created PR review comment:
Noted!
pchickey submitted PR review.
pchickey created PR review comment:
Thanks, done!
pchickey updated PR #5055 from pch/component_model_async
to main
.
pchickey has marked PR #5055 as ready for review.
pchickey updated PR #5055 from pch/component_model_async
to main
.
alexcrichton submitted PR review.
alexcrichton merged PR #5055.
Last updated: Nov 22 2024 at 17:03 UTC