Flagsmith / Flagsmith/flagsmith-python-client

Local evaluation with multiprocessing environment

未關閉
#77 0 則留言 1 個 reaction 已指派 2 人 已指派給 @khvn26 在 GitHub 檢視
bug
主要語言
Python
星號
24
分支
12
平均合併
15 小時 43 分鐘
30 天內合併 PR
4

描述

## 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?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。