ajaydeta / grpc-stream-example

This is a simple example of a gRPC stream in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang gRPC Stream Example

This is a simple example of a gRPC stream in Golang.

Abstract

what is gRPC?

gRPC is an open-source remote procedure call (RPC) framework developed by Google. RPC is a communication protocol that enables applications on different systems to communicate with each other and invoke functions or procedures remotely, as if they were on the same machine.

In simple terms, gRPC allows applications to talk to each other and make remote function calls efficiently and uniformly. It leverages Protocol Buffers (protobuf) technology to define message formats and service interfaces.

what is stream?

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 common types are unary (client sends a single request and gets a single response) and server streaming (client sends a single request and gets a stream of responses) or vice versa.

How to run

Prerequisites

Run

  1. Clone this repository
git clone https://github.com/ajaydeta/grpc-stream-example.git
  1. Install dependencies
make dependencies
  1. Generate protobuf
make proto
  1. Run server
  • you can run server with this command:
make server
  • you can also run server and access it using client with this command:
make run

References

About

This is a simple example of a gRPC stream in Golang


Languages

Language:Go 92.5%Language:Makefile 7.5%