Skip to content

Commit

Permalink
Add capnp-rpc-lwt compatibility package
Browse files Browse the repository at this point in the history
This allows existing libraries using capnp-rpc-lwt to be used with
applications using Eio, easing the transition.
  • Loading branch information
talex5 committed Nov 27, 2024
2 parents 54b0506 + 181e34e commit b6116f0
Show file tree
Hide file tree
Showing 158 changed files with 4,726 additions and 4,384 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
Expand Down
26 changes: 26 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
### v2.x

- Rename `Capnp_rpc_lwt` to `Capnp_rpc` (which is now `Capnp_rpc_proto`).
The new `Capnp_rpc` now provides `Error`, `Exception` and `Debug` aliases
to the same modules in `Capnp_rpc_proto`, so that `Capnp_rpc_proto` doesn't
need to be used directly.

- Add `Capnp_rpc.Std` with some common module aliases, to reduce the need
to `open Capnp_rpc` (which is rather large).

- Convert API from Lwt to Eio.

To update to the new API:

1. Use [lwt_eio][] during the migration to allow using Eio and Lwt together in your application.
2. Replace `open Capnp_rpc_lwt` with `open Capnp_rpc.Std`.
3. Replace all other uses of `Capnp_rpc_lwt` with just `Capnp_rpc`.
4. In `dune` and `opam` files, replace `capnp-rpc-lwt` with `capnp-rpc`.
5. Some modules are in `Capnp_rpc` but not the `Capnp_rpc.Std` subset.
Those should now be fully qualified (e.g. replace `Persistence` with
`Capnp_rpc.Persistence`).
6. Replace `Service.return_lwt` with `Lwt_eio.run_lwt`.
7. Once all Lwt code is gone, `lwt_eio` can be removed.

[lwt_eio]: https://github.com/ocaml-multicore/lwt_eio

### v1.2.3

- Update to cmdliner 1.1.0 (@MisterDA #249).
Expand Down
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

default: test build-fuzz

all:
dune build @install test/test.exe test-lwt/test_lwt.exe test-bin/calc.exe
rm -rf _build/_tests
dune runtest --no-buffer -j 1

build-fuzz:
dune build fuzz/fuzz.exe

Expand All @@ -19,7 +14,5 @@ clean:

test:
rm -rf _build/_tests
dune build test/test.exe test-lwt/test_lwt.exe test-bin/calc.exe test-bin/echo/echo_bench.exe @install
#./_build/default/test/test.bc test core -ev 36
#./_build/default/test-lwt/test.bc test lwt -ev 3
dune build test test-bin @install
dune build @runtest --no-buffer -j 1
Loading

0 comments on commit b6116f0

Please sign in to comment.