capnproto-rust icon indicating copy to clipboard operation
capnproto-rust copied to clipboard

Add support for setPipeline()

Open edevil opened this issue 2 years ago • 3 comments

Context: https://github.com/capnproto/capnproto/pull/1131

In the c++ capnproto lib this feature was added that allows, as @kentonv says:

This makes it possible, when an RPC forwards to another RPC, to start forward pipelined calls on the first to the second, before the first RPC actually completes.

Would it be possible to support this in capnproto-rust as well?

Thanks.

edevil avatar Mar 01 '23 19:03 edevil

For a real-world example where this matters, compare request() and startRequest() in http-over-capnp.capnp.

https://github.com/capnproto/capnproto/blob/master/c%2B%2B/src/capnp/compat/http-over-capnp.capnp#L47

The introduction of setPipeline() made it possible to simplify this interface (request() being the new, simpler version, where startRequest() was what we needed before). However, it's currently not possible to implement request() in Rust.

kentonv avatar Mar 01 '23 20:03 kentonv

Yeah, this should be possible. I took some some small first steps here: https://github.com/capnproto/capnproto-rust/pull/380 Probably this will require a version bump, because we will need to change the signature of ClientHook.call() to additionally return a pipeline, and we will need to modify ResultsHook too.

dwrensha avatar Mar 02 '23 21:03 dwrensha

We require this feature for our project. Unfortunately, #380 contains only stubs and minimal direction on what actually needs to happen to implement this feature. Would it be possible for @dwrensha to provide a more detailed explanation of everything that needs to change for this to be implemented correctly? I can then try my hand at providing a PR that implements this.

ErikMcClure avatar Jun 17 '24 02:06 ErikMcClure

Implemented in #515, without modifying the return type of ClientHook.call().

dwrensha avatar Sep 08 '24 21:09 dwrensha