/gRPC-multiprocessing

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

Primary LanguagePythonMIT LicenseMIT

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