Capnproto RPC for Java - work in progress.

68 views
Skip to first unread message

Vaci

unread,
Oct 3, 2020, 4:54:54 PM10/3/20
to Cap'n Proto
Hi all,

With some free time in my hands, I decided to have a go at writing the RPC protocol in Java, as least for two-party connections, using Java 8 CompletableFutures as a analogue of the KJ async event management layer. 

I have got as far as being able to transfer capabilities between clients, and make calls to remote methods. There is still a fair amount to do in handling pipelining, disconnection and finish operations, but the implementation looks promising so far. The code sticks fairly closely to the C++ original, mostly to make my debugging efforts easier.

I hope to start looking at extending the Java compiler stage for interfaces next, now that I have an idea of what the generated client and server code might look like.

If anybody is interested,, the code is on Github:

   https://github.com/vaci/capnproto-java-rpc

Cheers,
Vaci

David Renshaw

unread,
Oct 4, 2020, 10:15:29 PM10/4/20
to Vaci, Cap'n Proto
Cool! Thanks for sharing.

How are you approaching concurrency? Are objects constrained to execute on a single thread, as in the C++ implementation?

- David

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/63d14b08-e972-4239-ab27-258896872c19n%40googlegroups.com.

Vaci

unread,
Oct 5, 2020, 2:29:17 PM10/5/20
to Cap'n Proto
Yes, my assumption so far is that each RpcSystem will execute on a single thread. There's no asynchronous dispatch of completion handlers in the code, so I expect only the socket IO (which completes on the background thread pool) will need synchronisation.

Vaci

Vaci

unread,
Oct 15, 2020, 1:03:41 PM10/15/20
to Cap'n Proto
Made some  progress over the last week or so - can now generate client and server interfaces,  and make pipelined calls between two RPC systems. Next is to test disconnection and exception handling.

I have not attempted to generate code for generic interfaces - it looks like there is some support already in the compiler, but it wasn't entirely clear to me how to use the generated output?

Vaci
Reply all
Reply to author
Forward
0 new messages