You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RpcModule doesn't implement Clone and ideally we should some way to construct it once and re-use it to register on several servers such as running the servers on different ports or something similar.
let module = RpcModule::new();
ws_server.register_module(module.clone());
http_server.register_module(module.clone());
Best way is probably to provide some builder that merges the modules when server.start is called.
The text was updated successfully, but these errors were encountered:
niklasad1
changed the title
[rpc module]: possibility to re-use module different servers.
[rpc module]: possibility to re-use modules on different servers.
May 20, 2021
This should be easily achievable by making the Methods use Arc<HashMap<_, _>> internally, using Arc::make_mut for adding new methods. Sync methods will need to change from Box<dyn _> to Arc<dyn _> like async methods, which should also unlock a straight forward way to do method aliasing (#378).
The
RpcModule
doesn't implementClone
and ideally we should some way to construct it once and re-use it to register on several servers such as running the servers on different ports or something similar.Best way is probably to provide some builder that merges the modules when
server.start
is called.The text was updated successfully, but these errors were encountered: