All Projects → ridha → Grpc Streaming Demo

ridha / Grpc Streaming Demo

A quick demo of bi-directional streaming RPC's using grpc, go and python3

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Grpc Streaming Demo

Grpc Spring Boot Starter
Spring Boot starter module for gRPC framework.
Stars: ✭ 1,829 (+1087.66%)
Mutual labels:  grpc
Grpc Cmake Example
gRPC C++ example with CMake
Stars: ✭ 142 (-7.79%)
Mutual labels:  grpc
Grpc Caller
An improved Node.js gRPC client
Stars: ✭ 151 (-1.95%)
Mutual labels:  grpc
Grpcui
An interactive web UI for gRPC, along the lines of postman
Stars: ✭ 2,490 (+1516.88%)
Mutual labels:  grpc
Grpc Haskell
gRPC library binding for Haskell.
Stars: ✭ 141 (-8.44%)
Mutual labels:  grpc
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-4.55%)
Mutual labels:  grpc
Abp.grpc
基于 ABP 框架开发的 Grpc 模块,支持 Consul 服务发现与服务注册。Grpc module developed based on ABP framework supports early service discovery and service registration.
Stars: ✭ 134 (-12.99%)
Mutual labels:  grpc
Cete
Cete is a distributed key value store server written in Go built on top of BadgerDB.
Stars: ✭ 153 (-0.65%)
Mutual labels:  grpc
Gf Cli
GoFrame Command Line Interface, which is your helpmate for building GoFrame application with convenience.
Stars: ✭ 143 (-7.14%)
Mutual labels:  grpc
Plasma
universal server push middleware by using gRPC stream and Server Sent Events(SSE)
Stars: ✭ 151 (-1.95%)
Mutual labels:  grpc
Coolstore Microservices
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 1,903 (+1135.71%)
Mutual labels:  grpc
Grpc Lb
Example for grpc-lb with etcd
Stars: ✭ 140 (-9.09%)
Mutual labels:  grpc
Zeebe
Distributed Workflow Engine for Microservices Orchestration
Stars: ✭ 2,165 (+1305.84%)
Mutual labels:  grpc
Cmakeprotosgrpc
gRPC + protobuf using CMake example
Stars: ✭ 137 (-11.04%)
Mutual labels:  grpc
Grpc Spring Boot Starter
Spring Boot starter module for gRPC framework.
Stars: ✭ 2,190 (+1322.08%)
Mutual labels:  grpc
Gax Java
Google API Extensions for Java - shared runtime for clients generated by googleapis/gapic-generator
Stars: ✭ 134 (-12.99%)
Mutual labels:  grpc
Core
Eru, a simple, stateless, flexible, production-ready orchestrator designed to easily integrate into existing workflows. Can run any virtualization things in long or short time.
Stars: ✭ 147 (-4.55%)
Mutual labels:  grpc
Go Grpc Example
An example of gRPC
Stars: ✭ 153 (-0.65%)
Mutual labels:  grpc
Fortio
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Stars: ✭ 2,199 (+1327.92%)
Mutual labels:  grpc
Keras Serving
bring keras-models to production with tensorflow-serving and nodejs + docker 🍕
Stars: ✭ 150 (-2.6%)
Mutual labels:  grpc

Streaming RPC's using gRPC

gRPC is a language-neutral, platform-neutral RPC framework that is quickly taking on JSON/HTTP as the recommended way to communicate between microservices.

Its main selling points are:

  • Communication is based on HTTP2 transport. This provides all the advantages of the HTTP2 (compression, multiplexing, streaming)
  • Well-defined schemas via Protocol Buffers 3
  • Automatic client code generation for 10 different languages.
  • Bi-directional streaming

By default, gRPC uses Protocol Buffers as the Interface Definition Language (IDL) and as its underlying message interchange format.

In this project, we'll implement a simple PrimeFactorService that returns a stream of the prime factors of the numbers passed to it in a request. I decided to make my gRPC server in Go and client in Python. The client program will read from stdin and will immediately push it to the service.

Generate gRPC code for server and client

We are going to use gRPC to generate libraries for Go and Python 3. To generate the Go code, you'll need to install protoc_.

.. _protoc: https://github.com/google/protobuf/#protocol-compiler-installation

.. code-block:: bash

Python client

$ pip3 install -U grpcio grpcio-tools $ python3 -m grpc_tools.protoc -I protobuf/ --python_out=. --grpc_python_out=. protobuf/primefactor.proto

Go

$ protoc -I protobuf/ --go_out=plugins=grpc:protobuf/ protobuf/primefactor.proto

The first command will generate primefactor_pb2.py and primefactor_pb2_grpc.py. The latter will generate primefactor.pb.go.

To start the server, simply run:

.. code-block:: bash

go run server.go

You can run the client using:

.. code-block:: bash

python3 client.py

.. image:: demo.gif

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].