What is a good way to reduce the number of workers on a machine in Python-RQ?
According to the documentation , I need to send a SIGINT or SIGTERM command to one of the work processes on the machine:
Worker removal
If at any moment the worker receives SIGINT (via Ctrl + C ) or SIGTERM (via kill ), the worker waits until the current work is completed, stop the work cycle and gracefully register his own death.
If SIGINT or SIGTERM returned during this retransmission phase, the worker will forcefully terminate the child process (by sending it SIGKILL ), but still try to register his own death.
This seems to imply a lot of coding overhead:
- You will need to track the PID for the workflow.
- You will need to have a way to send a SIGINT command from a remote computer.
Do I need to customize this assembly, or is there a way to do this easily using the Python-RQ library or another existing library?
source share