capnp-rpc
capnp-rpc copied to clipboard
Initial Eio port
This switches capnp-rpc from Lwt to Eio. One particularly nice side effect of this is that Service.return_lwt
has gone, as there is no distinction now between concurrent and non-concurrent service methods.
Notes:
- In this commit, everything is still using the "lwt" names to make the diff useful. In a future commit, this should be renamed. Also, some of the "unix" functions can be moved into the core library with Eio. This would likely be a good time to rename
capnp_rpc
tocapnp_rpc_protocol
or something, leaving the short name free for the main library. - Mirage support is gone. Ideally, the regular library should work with Mirage 5.
This commit aims to keep the diff (relatively) small. Several more things are needed after this is merged. In particular:
- Performance improvements (such as sending multiple messages at once).
- Handling leaked refs correctly. We need to schedule a callback on our owning domain's event loop from the finalizer. Eio doesn't currently provide a way to do this.
- The example code needs cleaning up. In particular, it's ugly that it raises
Exit
to finish. - The included tls_eio support module should be cleaned up and submitted upstream.
- Once Eio supports conditions, that code should move to Eio.
Can we keep the LWT version available for OCaml 4.14? We will need to move services to OCaml 5 and EIO over a longer period of time, both for platform support reasons and just because it will take some time to port things over.
Can we keep the LWT version available for OCaml 4.14?
The existing release will continue to work there. capnp-rpc is pretty stable, so I'm not expecting any major new features that would need back-porting.
We'll take a release of this when it's ready. clarke and solver-service could use it.