I have a flask app, from which I need to start few other apps (webrtc chats.) I can easily do it with gunicorn, but my problem is how to start 5-10-15 or more webrtc apps( can do this with gunicorn command) and then stop some of them but not all.
So with this:
gunicorn --worker-class eventlet -w 1 --certfile /path/to/file --keyfile /path/to/file -b 0.0.0.0:8000 wsgi:app
command to start the server, each manager will start a server on its own port, no problems here. But how to store a process and then kill it, when the manager no longer needs server? I have no idea--any tips?
args = 'exec ' + gunicorn_command_above
p = subprocess.Popen(args, stdout=subprocess.PIPE, shell=True)
So i can start servers with commands above, but don't know how to store and then kill process, thx for your time and help!