Skip to content

Missing API to drop guest ResourceAny concurrently #14291

Description

@SilverMira

Hello, sorry for commenting on this old issue, but with the new component-model-async APIs, I couldn't find a way to drop a guest's resource, I'm within a wasmtime::component::AccessorTask with a guest exported ResourceAny, and I couldn't use accessor.with(|store| resource.resource_drop_async(store)) due to trying to return a future that captures store.

For now, I'm writing as accessor.with(|store| futures::block_on(resource.resource_drop_async(store))), but no idea whether this is the intended way, or will it cause deadlocks because it will block the store's event loop

Originally posted by @SilverMira in #9946

As confirmed by @alexcrichton in the above issue, Wasmtime doesn't yet have an intended way to drop a guest's ResourceAny within Store::run_concurrent

We probably need something like a async fn resource_drop_concurrent(self, accessor: impl AsAccessor) -> wasmtime::Result<()> on ResourceAny

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions