sozu icon indicating copy to clipboard operation
sozu copied to clipboard

Keep a worker id within a worker

Open Keksoj opened this issue 2 years ago • 2 comments

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.

Keksoj avatar Sep 06 '22 12:09 Keksoj

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.

Keksoj avatar Sep 12 '22 09:09 Keksoj

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.

Keksoj avatar Sep 12 '22 14:09 Keksoj