Missing API to drop guest ResourceAny concurrently
Hello, sorry for commenting on this old issue, but with the new
component-model-asyncAPIs, I couldn't find a way to drop a guest's resource, I'm within awasmtime::component::AccessorTaskwith a guest exportedResourceAny, and I couldn't useaccessor.with(|store| resource.resource_drop_async(store))due to trying to return a future that capturesstore.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
Source: bytecodealliance/wasmtime