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
In our test suite, we use RpcModule::raw_json_request to simulate calls to our server, without having to spin up an actual HTTP/WS server.
This works for the most part, however the id_provider for subscriptions is set on the Server, rather than RpcModule. Therefore, RpcModule uses the default RandomIntegerIdProvider, despite our actual implementation using a different provider.
Currently, I am hacking around this in the glue code of our test suite, but it would be nice to avoid that.
In the best case scenario, would it be possible to move the id_provider lower down the stack to the RpcModule? Alternatively, if that isn't possible or feasible, could we let the user pass an id_provider in calls to raw_json_request?
The text was updated successfully, but these errors were encountered:
I had a look and adding the id provider to the RpcModule itself is massive change because it's generated by the proc maco API and we have no notion of the subscription ID generation in there....
So, what you do think about:
Change the API to RpcModule::raw_json_request(&self, request: &str, buf_size: usize, id_provider: &dyn IdProvider) {...}
Add another API RpcModule::subscribe_with_provider(&self, sub_method: &str, params: impl ToRpcParams, buf_size: usize, id_provider: &dyn IdProvider) {...}
In our test suite, we use
RpcModule::raw_json_request
to simulate calls to our server, without having to spin up an actual HTTP/WS server.This works for the most part, however the
id_provider
for subscriptions is set on theServer
, rather thanRpcModule
. Therefore,RpcModule
uses the defaultRandomIntegerIdProvider
, despite our actual implementation using a different provider.Currently, I am hacking around this in the glue code of our test suite, but it would be nice to avoid that.
In the best case scenario, would it be possible to move the
id_provider
lower down the stack to theRpcModule
? Alternatively, if that isn't possible or feasible, could we let the user pass anid_provider
in calls toraw_json_request
?The text was updated successfully, but these errors were encountered: