Closed kayhhh closed 6 months ago
Well ended up getting a bit more complicated when I tried using WasiCtx within the Store type but I think thats working now too, by adding Sync
to the streams.
I am using this is a Bevy game too and ended up putting my store in an Arc Mutex, which works out too. But matching the Sync
-ness of wasmtime's Store is probably a better idea, I will look into the PR next weekend.
I have made Store Send and Sync in 0.3.2, and also in 0.4.0. Looking at the commits: @kayhhh replace LazyModuleMemory with Arc RwLock eca64d9 @kayhhh undo LazyModuleMemory Arc change I totally get it, I made it thread safe too until clippy explained to me that it's useless because ModuleMemory (which contains a JsValue) cannot be sent between threads anyway.
Hi, I am trying to use this crate with Bevy, but cannot easily do so without
Store
beingSync
. This is already the case with thewasmtime
native build, but for the web build there is aRc<RefCell<...>>
causing issues.I naively replaced it with
Arc<RwLock<...>>
, and while I'm not sure whether its correct to do so it let my code compile.Awesome project by the way great work.