Cap’n Proto library for Erlang.
Serialization should be pretty stable, also supporting packed messages.
RPC is almost complete for level 1, but not yet stable (the sample calculator application is working, both client and server).
Naturally, the Cap’n Proto framework is needed
in order to compile any
.capnp schema files.
If you are troubleshooting a Cap’n Proto RPC communication, it may pay to be able to dissect the protocol to see what is actually being said. For that purpose, there is a Wireshark Cap’n Proto dissector.
Build and install
ecapnp somewhere in you
capnp to compile schema files to be used in Erlang:
capnp compile -oerl <schemafile.capnp>
capnp compile --help for compile options.
It compiles the schema to a
schemafile_capnp.beam module for you to
use whenever you need to read/write Cap’n Proto messages.
Read the documentation. (still butt ugly, sorry :/ )
In the Cap’n Proto distribution there is both a AddressBook and a
Calculator example, which have been ported to Erlang using
ecapnp. They live in the
priv/samples directory, and may be
There are both unit tests and integration tests. The unit tests are
implemented using both
proper and are run using the
Erlang Common Test Framework, started with the command:
The integration kind of tests are provided and run by the
capnp_test framework (which is a
language agnostic test framework for Cap’n Proto compiler plugins),
and is invoked with the command:
On Windows (should you be unfortunate enough to be on that platform)
there is a rather bad design decision in Erlang to convert all
\n that are read from
stdin. Either patch
source, or avoid reading Cap’n Proto messages from
(I used to have a patch for erl 188.8.131.52 I just might be able to dig up, in case you need it)