The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
C++ Python C# C Makefile Ruby Other
Switch branches/tags
Latest commit 2b0ab32 Jan 4, 2018 @kpayson64 kpayson64 Merge pull request #13794 from kpayson64/fix_server_streamz_stats
Set error status correctly on server side
Permalink
Failed to load latest commit information.
.github Add OWNERS to protect scenario_result_schema.json Dec 12, 2017
.vscode Adding shim for debugging node tests using vscode. Feb 21, 2017
bazel Move more special cases in bazel build to the .bzl files Dec 15, 2017
cmake simplify top level CMakeLists.txt Dec 19, 2017
doc fix PROTOCOL-HTTP2 to PROTOCOL-HTTP2.md Dec 29, 2017
etc minor fix Aug 2, 2017
examples Upgrade yapf to 0.20.0 Jan 2, 2018
include Merge pull request #13874 from vjpai/allow_no_message Jan 2, 2018
src Set error status correctly on server side Jan 4, 2018
summerofcode Add project overview for gsoc submission Aug 23, 2016
templates Merge pull request #13830 from jtattermusch/cmake_cleanup Dec 23, 2017
test Set error status correctly on server side Jan 4, 2018
third_party Packs contents of WORKSPACE into a bzl function, so that it can be re… Dec 15, 2017
tools Set error status correctly on server side Jan 4, 2018
vsprojects Merge branch 'master' of github.com:grpc/grpc into filters_prio Sep 7, 2017
.clang-format Update clang-format to 5.0 Nov 3, 2017
.clang_complete Enable clang-tidy as a sanity check, fix up all known failures Nov 10, 2017
.editorconfig Adding an editorconfig configuration file. Jan 31, 2015
.gitignore Pass a pollset_set to some client handshakers. Dec 5, 2017
.gitmodules Fetch boringssl-with-bazel submodule from GitHub Dec 29, 2017
.istanbul.yml Moved gRPC node package root to repo root, made it depend on grpc.gyp Oct 1, 2015
.pylintrc gRPC Python test infrastructure Aug 3, 2017
.rspec Bundled C core with Ruby library Dec 18, 2015
.travis.yml Have Travis build the Sample app with frameworks too Jul 16, 2016
.yardopts Adding a .yardopts file at the root so rubydocs isn't getting lost. Feb 13, 2016
AUTHORS change LICENSE, add AUTHORS Jun 8, 2017
BUILD Move more special cases in bazel build to the .bzl files Dec 15, 2017
CMakeLists.txt Set error status correctly on server side Jan 4, 2018
CODE-OF-CONDUCT.md Fix code of conduct Jun 8, 2017
CONTRIBUTING.md Updated CLA link to reflect migration to Linux Foundation. Nov 29, 2017
Gemfile Bundled C core with Ruby library Dec 18, 2015
INSTALL.md address comments Nov 30, 2017
LICENSE fix license file Jun 19, 2017
MANIFEST.md Remove tox Jul 1, 2016
Makefile Set error status correctly on server side Jan 4, 2018
NOTICE.txt change LICENSE, add AUTHORS Jun 8, 2017
OWNERS Add policy to comment Jul 17, 2017
PYTHON-MANIFEST.in Changes Apr 14, 2017
README.md Update README.md Copyright Notice Dec 21, 2017
Rakefile Ignoring all ruby build errors for now Oct 2, 2017
WORKSPACE Packs contents of WORKSPACE into a bzl function, so that it can be re… Dec 19, 2017
build.yaml Merge branch 'master' of github.com:grpc/grpc into backoff_cpp Dec 13, 2017
build_config.rb Decouple alarm construction from setting to avoid races in MT code Sep 7, 2017
composer.json Use https://grpc.io consistently as the canonical URL Jul 10, 2017
config.m4 Move histogram to test/core/util Nov 30, 2017
config.w32 Move histogram to test/core/util Nov 30, 2017
gRPC-Core.podspec Set error status correctly on server side Jan 4, 2018
gRPC-ProtoRPC.podspec Merge branch 'master' of https://github.com/grpc/grpc into upmerge-fr… Nov 29, 2017
gRPC-RxLibrary.podspec Merge branch 'master' of https://github.com/grpc/grpc into upmerge-fr… Nov 29, 2017
gRPC.podspec Merge branch 'master' of https://github.com/grpc/grpc into upmerge-fr… Nov 29, 2017
grpc.bzl fix remaining license notices Jun 8, 2017
grpc.def Move histogram to test/core/util Nov 30, 2017
grpc.gemspec Move histogram to test/core/util Nov 30, 2017
grpc.gyp Set error status correctly on server side Jan 4, 2018
package.xml Move histogram to test/core/util Nov 30, 2017
requirements.txt Update Python dependency to protobuf v3.5.0.post1 Nov 27, 2017
setup.cfg Enable running Python formatting Jan 17, 2017
setup.py Allow compiling grpc without use of pthread_atfork Nov 30, 2017

README.md

Build Status

gRPC - An RPC library and framework

Join the chat at https://gitter.im/grpc/grpc

Copyright 2015 The gRPC Authors

Documentation

You can find more detailed documentation and examples in the doc and examples directories respectively.

Installation & Testing

See INSTALL for installation instructions for various platforms.

See tools/run_tests for more guidance on how to run various test suites (e.g. unit tests, interop tests, benchmarks)

See Performance dashboard for the performance numbers for the latest released version.

Repository Structure & Status

This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library src/core.

Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries.

Language Source
Shared C [core library] src/core
C++ src/cpp
Ruby src/ruby
Python src/python
PHP src/php
C# src/csharp
Objective-C src/objective-c

Java source code is in the grpc-java repository. Go source code is in the grpc-go repository. NodeJS source code is in the grpc-node repository.

See MANIFEST.md for a listing of top-level items in the repository.

Overview

Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages.

Interface

Developers using gRPC typically start with the description of an RPC service (a collection of methods), and generate client and server side interfaces which they use on the client-side and implement on the server side.

By default, gRPC uses Protocol Buffers as the Interface Definition Language (IDL) for describing both the service interface and the structure of the payload messages. It is possible to use other alternatives if desired.

Surface API

Starting from an interface definition in a .proto file, gRPC provides Protocol Compiler plugins that generate Client- and Server-side APIs. gRPC users typically call into these APIs on the Client side and implement the corresponding API on the server side.

Synchronous vs. asynchronous

Synchronous RPC calls, that block until a response arrives from the server, are the closest approximation to the abstraction of a procedure call that RPC aspires to.

On the other hand, networks are inherently asynchronous and in many scenarios, it is desirable to have the ability to start RPCs without blocking the current thread.

The gRPC programming surface in most languages comes in both synchronous and asynchronous flavors.

Streaming

gRPC supports streaming semantics, where either the client or the server (or both) send a stream of messages on a single RPC call. The most general case is Bidirectional Streaming where a single gRPC call establishes a stream where both the client and the server can send a stream of messages to each other. The streamed messages are delivered in the order they were sent.

Protocol

The gRPC protocol specifies the abstract requirements for communication between clients and servers. A concrete embedding over HTTP/2 completes the picture by fleshing out the details of each of the required operations.

Abstract gRPC protocol

A gRPC RPC comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory Call Header, followed by optional Initial-Metadata, followed by zero or more Payload Messages. The server-to-client direction contains an optional Initial-Metadata, followed by zero or more Payload Messages terminated with a mandatory Status and optional Status-Metadata (a.k.a.,Trailing-Metadata).

Implementation over HTTP/2

The abstract protocol defined above is implemented over HTTP/2. gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of Call Header and Initial Metadata are sent as HTTP/2 headers and subject to HPACK compression. Payload Messages are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. Status and Trailing-Metadata are sent as HTTP/2 trailing headers (a.k.a., trailers).

Flow Control

gRPC inherits the flow control mechanisms in HTTP/2 and uses them to enable fine-grained control of the amount of memory used for buffering in-flight messages.