Skip to content

Expose when component model async tasks finish, not just return #11600

Closed

Description

@alexcrichton

Today Func::call_concurrent will resolve when the guest invokes task.return, but the guest can continue running. This concept, supported by the component model, should be modeled in Wasmtime's embedder API as well. For example the return value of call_concurrent could always return a WasmTask argument (or something like that) which can then be used to await with an &Accessor just as a function could be called concurrently. This would enable the embedder to, optionally, explicitly wait on guests that would like to continue running. Additionally the embedder could learn about traps during this time frame, but no other results would come out of the guest.

Activity

  1. moved this to Backlog in Ship WASIp3on Sep 3, 2025
  2. rvolosatovs commented on Sep 8, 2025

    @rvolosatovs
    Member

    This makes a lot of sense! As an embedder I would expect to be able to acquire a construct similar to https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html

  3. moved this from Backlog to In progress in Ship WASIp3on Sep 9, 2025
  4. added a commit that references this issue on Sep 10, 2025
    dc51cca
  5. added a commit that references this issue on Sep 10, 2025
    080faa1
  6. moved this from In progress to Done in Ship WASIp3on Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wasm-proposal:component-model-asyncIssues related to the WebAssembly Component Model async proposalwasmtime:apiRelated to the API of the `wasmtime` crate itself

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions