Skip to content

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

License

Notifications You must be signed in to change notification settings

fpaupier/gRPC-multiprocessing

Repository files navigation

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 [email protected]: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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published