https://github.com/pramonow/go-grpc-server-streaming-example
golang grpc server side streaming example
https://github.com/pramonow/go-grpc-server-streaming-example
golang grpc
Last synced: 2 months ago
JSON representation
golang grpc server side streaming example
- Host: GitHub
- URL: https://github.com/pramonow/go-grpc-server-streaming-example
- Owner: pramonow
- License: mit
- Created: 2020-11-10T03:29:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-20T10:42:41.000Z (10 months ago)
- Last Synced: 2025-05-20T11:48:50.417Z (10 months ago)
- Topics: golang, grpc
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 27
- Watchers: 1
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Golang grpc server streaming example
Simple grpc server streaming capability with Golang, this code will have server and client each:
* Server: Will have a function that will stream 5 responses with slight delay each.
* Client: Will send a request to server and wait on all the responses.
---
# Running it
Run with makefile
```
make all
```
This will create the pb file for grpc and also the client and server binary.
---
# Usage
## Build Docker Image using docker compose
```
docker-compose -f docker-compose.yml build
```
## Run up all docker containers using docker compose
```
docker-compose -f docker-compose.yml up
```
This will be shown in client
```
2020/11/10 22:26:11 Resp received: Request #0 For Id:1
2020/11/10 22:26:12 Resp received: Request #1 For Id:1
2020/11/10 22:26:13 Resp received: Request #2 For Id:1
2020/11/10 22:26:14 Resp received: Request #3 For Id:1
2020/11/10 22:26:15 Resp received: Request #4 For Id:1
2020/11/10 22:26:15 finished
```
This will be shown in server
```
2020/11/10 22:26:09 start server
2020/11/10 22:26:11 fetch response for id : 1
2020/11/10 22:26:11 finishing request number : 0
2020/11/10 22:26:12 finishing request number : 1
2020/11/10 22:26:13 finishing request number : 2
2020/11/10 22:26:14 finishing request number : 3
2020/11/10 22:26:15 finishing request number : 4
```