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
Currently the RpcServiceT is very similar to the tower::Service
pubtraitRpcServiceT<'a>{/// The future response value.typeFuture:Future<Output = MethodResponse> + Send;/// Process a single JSON-RPC call it may be a subscription or regular call./// In this interface they are treated in the same way but it's possible to/// distinguish those based on the `MethodResponse`.fncall(&self,request:Request<'a>) -> Self::Future;
and it should be modified to
pubtraitRpcServiceT<'a>{/// Process a single JSON-RPC call it may be a subscription or regular call./// In this interface they are treated in the same way but it's possible to/// distinguish those based on the `MethodResponse`.fncall(&self,request:Request<'a>) -> implFuture<Output = MethodResponse> + Send;}
The reason is that in many cases the current design ends up with that the Future needs to be Boxed
or a complicated ResponseFuture has to be written. With impl Future is much more flexible and would improve things.
The only reason why we haven't changed this is because changing this ends up with rustc generic lifetime error, rust-lang/rust#100013
The text was updated successfully, but these errors were encountered:
Currently the RpcServiceT is very similar to the tower::Service
and it should be modified to
The reason is that in many cases the current design ends up with that the Future needs to be Boxed
or a complicated ResponseFuture has to be written. With
impl Future
is much more flexible and would improve things.The only reason why we haven't changed this is because changing this ends up with rustc generic lifetime error, rust-lang/rust#100013
The text was updated successfully, but these errors were encountered: