rpc.md 1.42 KB
layout: page

RPC Protocol

The Cap'n Proto RPC protocol is not yet defined. See the language spec's section on interfaces for a hint of what it will do.

Here are some misc planned / hoped-for features:

  • Shared memory IPC: When instructed to communicate over a Unix domain socket, Cap'n Proto may automatically negotiate to use shared memory, by creating a temporary file and then sending a file descriptor across the socket. Once messages are being allocated in shared memory, RPCs can be initiated by merely signaling a futex (on Linux, at least), which ought to be ridiculously fast.

  • Promise Pipelining: When an RPC will return a reference to a new remote object, the client will be able to initiate calls to the returned object before the initial RPC has actually completed. Essentially, the client says to the server: "Call method foo of the object to be returned by RPC id N." Obviously, if the original RPC fails, the dependent call also fails. Otherwise, the server can start executing the dependent call as soon as the original call completes, without the need for a network round-trip. In the object-capability programming language E this is known as promise pipelining.