#14291·wasmtime

缺少用于同时删除客户端 ResourceAny 的 API

作者: SilverMira创建于 2026年9月7日更新于 2026年9月7日
标签wasmtime:apiwasm-proposal:component-model-async

你好,很抱歉对这个老问题发表评论,但使用新的 component-model-async API,我找不到一种方法来删除客户的资源,我处于一个 wasmtime::component::AccessorTask 中,客户导出了 ResourceAny,而我无法使用 accessor.with(|store| resource.resource_drop_async(store)),因为尝试返回捕获 store 的未来。 目前,我正在以 accessor.with(|store| futures::block_on(resource.resource_drop_async(store))) 的形式编写代码,但不知道这是否是预期的方式,或者是否会导致死锁,因为它会阻塞存储的事件循环。 最初由 @SilverMira 在 #9946 中发布

由 @alexcrichton 在上述问题中确认的那样,Wasmtime 尚未为 Store::run_concurrent 中删除客户的 ResourceAny 提供预期的方法

内容来源: bytecodealliance/wasmtime