EIO with any RPC library

Hi,

I use OCaml 5 and failed to compile Thrift because the bindings require an earlier version of the compiler.

I am now trying to use capnp and it is based on Lwt. Believe it should be possible to use with eio. Are there examples ?

This is my first time. Are there any modern RPC libraries ?
I should adopt this approach ?

Mohan

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.

3 Likes

Hey @Mohan_Radhakrishnan,

@talex5 has already got a very comprehensive port of Capnp from Lwt to Eio: Initial Eio port by talex5 · Pull Request #256 · mirage/capnp-rpc · GitHub – note this is a direct port, not using Lwt_eio. I’ve had success building things from this branch.

Slightly confusingly this is still available under the library capnp-rpc-lwt.

Hi, the last published Thrift package requires OCaml <5 but the master branch has been updated since then and should work with OCaml 5+. You can try pinning it directly from GitHub: GitHub - vbmithr/ocaml-thrift-lib: Thrift library for OCaml extracted from Thrift sources

1 Like

I am going through the examples from this branch. Will try this.

Update : My simple RPC works.

  Lwt_main.run begin
    let service = Server.local in
    Client.ping service "foo" >>= fun reply ->
    Fmt.pr "Got reply %S@." reply;
    Lwt.return_unit
  end

The references to LWT are temporary. I presume.

Thanks.