sozu
sozu copied to clipboard
Keep a worker id within a worker
For a better worker management in the main process, it would be handy to have a worker_id
in the ProxyResponseData
sent by a worker (may be renamed as ProxyResponseContent
by now).
What would be cool is to pass the worker id to the Server::new_from_config()
in the worker creation of begin_worker_process
.
The id could be stored both in the Server
and Proxy
structs of a proxy.
The PR #803 solves this issue partially but we should still add the worker id in ProxyResponse, and revert the #803 change on the in_flight map.
Adding a worker to the ProxyResponse on the proxy side implies a lot of changes, since a lot of ProxyResponses are pushed on a QUEUE that floats around and is called from too many places. Handling the worker id in the worker loop, as we do since #803, seems like a good idea after all.