If you are not tied to capnp, you can also add ocaml-grpc to your study. It has a Eio backend available. Generally speaking, I’m interested about Eio+RPC as well (did some experiment with ocaml-grpc here).
I’d like to explore jsonrpc options too but didn’t get a chance to do it yet. Is there any option out there? The RPC lib used in dune looks great, however it has its own scheduler. I looked a bit into it here and I’d be curious to learn more.
I see. I may be missing the point here. I thought all dependencies on Lwt will be removed and only eio will be used henceforth. That means the entire RPC library will only need eio APIs ??
let connect uri =
Lwt_main.run begin
let client_vat = Capnp_rpc_unix.client_only_vat () in
let sr = Capnp_rpc_unix.Vat.import_exn client_vat uri in
Capnp_rpc_unix.with_cap_exn sr run_client
end