This repo contains code for my blog post explaining how to use gRPC in Go and Python. Do check it out.
The code in this repo is released under the terms of MIT License
Python gRPC Server (./python):
python -m grpc_tools.protoc -I. --python_out=./python --grpc_python_out=./python nltk_service.proto
python -m nltk.downloader stopwords
Go gRPC client (./golang):
protoc -I. nltk_service.proto --go_out=plugins=grpc:golang
Terminal 1 (python server):
brew install python
pip3 install virtualenv
virtualenv -p python3 .venv
pip install -r requirements.txt
source .venv/bin/activate
python python/server.py
Terminal 2 (Go client):
cd golang
go run client.go
- Mark
python
directory as "Sources root" (right click directory) - Enable Go modules (vgo) integration
- Import
golang
directory as a new folder to workspace in order for go-modules to work.