Flagsmith / Flagsmith/flagsmith-python-client

Local evaluation with multiprocessing environment

Ouverte
#77 0 commentaires 1 réaction 2 personnes assignées Assignée à @khvn26 Voir sur GitHub
bug
Langage dominant
Python
Étoiles
24
Forks
12
Merge moyen
15 h 43 min
PR mergées (30 j)
4

Description

## What
When running the client with local evaluation in a gunicorn server (or any multiprocessed environment), the workers environment is never updated

## Why
Gunicorn is designed around the pre-fork worker model (see [docs](https://docs.gunicorn.org/en/stable/design.html#server-model)). When instantiating the Flagsmith client, the polling updates the `_environment` variable in the master worker, but these changes will not affect the other workers. We would need to run a polling thread for each worker, which is not ideal

## Sharing the `_environment` between workers
Would you be open to a new feature that would allow pickling and sharing the data between processes using a [multiprocessing.Manager](https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Manager) or a redis?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.