fpaupier / gRPC-multiprocessing

A boilerplate to use multiprocessing for your gRPC server in your Python project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gRPC-multiprocessing

A boilerplate to use multiprocessing for your gRPC server in your Python project

This repo is a boilerplate showing how you can use multiprocessing with gRPC in python.

Getting started

This project offers a minimum reproducible example of clients sending batches of images to gRPC servers.

The client.py starts a pool of several gRPC channel. Each of those clients process send a batch to one of the gRPC server in parallel.

Copy the .env.example file into a .env file, adjust the NUM_IMAGES and NUM_WORKERS variables and start playing around by typing

git clone git@github.com:fpaupier/gRPC-multiprocessing.git && cd gRPC-multiprocessing

cp .env.example .env  # adjust the nº of workers as you wish
docker-compose run client
# INFO [/usr/app/client.py:126]: OCR Test client started. 
# INFO [/usr/app/client.py:115]: Reading src image...
# ...

Curated resources

on the Internet


Project social image credits to Miguel Á. Padriñán

About

A boilerplate to use multiprocessing for your gRPC server in your Python project

License:MIT License


Languages

Language:Python 89.9%Language:Dockerfile 7.9%Language:Shell 2.2%