Store is not Send since version 7.0.0
Hi, I am updating to the latest major release of the rust wasmer crate.
I found that the Store type has become !Send in a (as far as I can tell) undocumented change between the 6.1.0 and 7.0.0 releases due to the removal of the + Send constraint on the OnCalledHandler type.
Since I was relying on the Store to be send to schedule execution of instances with persistent state on different threads, since other WASM runtimes (wasmtime) have Send store types, and since it was Send in a previous version of wasmer, I wanted to ask whether this is intentional and the Store type will be !Send from now on, or if this is something that could go back to being Send as it were in previous versions.
To replicate this with minimal code, this snippet compiles in version 6.1.0, but doesn't in 7.0.0
use wasmer::Store;
trait MustBeSend: Send {}
struct StoreWrapper {
store: Store
}
impl MustBeSend for StoreWrapper {}Following the error brings this type, which used to be Send, but is not anymore:
pub type OnCalledHandler = Box<
dyn FnOnce(
StoreMut<'_>,
)
-> Result<wasmer_types::OnCalledAction, Box<dyn std::error::Error + Send + Sync>>,
>;I understand that my use case may not be a common one, as I am implementing some complex scheduling of instances in a multi-threaded scenario, however I think that having the Store type be Send would be beneficial, so I would like to understand whether this change was intentional, if it is needed to preserve the new functionality in wasmer, and if it would be possible to investigate ways to make it send again.
Thank you in advance for your time and consideration.
Source: wasmerio/wasmer