-
-
Notifications
You must be signed in to change notification settings - Fork 111
Comparison with stdlib rpc
Ross Light edited this page Dec 22, 2015
·
3 revisions
Go's standard library includes net/rpc
, which provides simple RPC functionality.
This page lists the advantages and disadvantages of using Cap'n Proto's RPC over net/rpc
with encoding/gob
:
- Cap'n Proto's encoding/protocol is language-agnostic. A server written in Go could have Python clients for quick one-off scripts.
- "Infinitely less" decoding time. There is no parse step: fields are at fixed offsets and stored in little-endian order.
- Capabilities expose methods instead of functions. This leads to cleaner stateful APIs.
- Peer-to-peer connections. Cap'n Proto connections don't have a "server" or "client": both sides can send capabilities to each other.
- Promise pipelining. Less round trips for chained method calls.
- No reflection overhead. Code generation.
-
Support for context/deadline propagation.
go-capnproto supports the
context.Context
interface, and the RPCs support cancellation.
-
Code generation makes your build process somewhat more complicated.
The
go generate
command alleviates this. -
No support for HTTP out-of-the-box.
Pull requests for such a
Transport
implementation are welcome. :)