sourcegraph/rpc

Name: rpc

Owner: Sourcegraph

Description: Go stdlib net/rpc with context.Context support

Created: 2018-03-29 20:22:37.0

Updated: 2018-03-29 20:38:14.0

Pushed: 2018-03-29 20:38:12.0

Homepage: null

Size: 28

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

rpc Build Status

This is a fork of the stdlib net/rpc which is frozen. It adds support for context.Context on the client and server, including propogating cancellation.

The API is exactly the same, except Client.Call takes a context.Context, and Server methods are expected to take a context.Context as the first argument.

Why use net/rpc

There are many alternatives for RPC in Go, the most popular being GRPC. However, net/rpc has the following nice properties:

The nice API is subjective. However, the API is small, simple and composable. which makes it quite powerful. IDL tools are things like GRPC requiring protoc to generate go code from the protobuf files. net/rpc has no third party dependencies nor code generation step, simplify the use of it. A benchmark done on the 6 Sep 2016 indicated net/rpc was 4x faster than GRPC. This is an outdated benchmark, but is an indication at the surprisingly good performance net/rpc provides.

For more discussion on the pros and cons of net/rpc see the issue proposal: freeze net/rpc.

Details

Forked from commit a89fa7040b on 25 January 2018.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.