capnproto-rust
capnproto-rust copied to clipboard
Add support for setPipeline()
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.
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.
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.
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.
Implemented in #515, without modifying the return type of ClientHook.call().