daemonocle
daemonocle copied to clipboard
Add more examples
Create examples folder with runnable scripts, the ones from the documentation. Please add more usage examples.
Such as:
- Using threading and how-to cleanly and safely stop the program.
- Using multiprosessing and how-to cleanly and safely stop the program.
- How-to handle file reloading with Flask and how-to cleanly and safely stop the program.
- WSGI: such as gunicorn (functionality like
gunicorn myapp:appbut with daemonizing) or wsgiref (using any WSGI server). - Show an example with setproctitle.
- Show how-to stop the daemon from inside the worker function.
I ask about these examples mainly because I do not know how-to cleanly and safely stop a threaded server that uses serve_forever. How do you send a stop signal to such a server? How do you do it safely and with predictable results?