Aug-21-2017, 06:53 PM
If it needs to run all the time, then a while True loop is good enough.
When it comes to config, I find the best types of config are the ones that are easy for real people to understand, instead of ones that are made for computers. So yaml is acceptable, but not really ideal. toml is currently my favorite format for this, as it supports nested groupings, without being strict about data types.
When it comes to communicating with a long running process, the main question you should ask yourself is what you want it to do if it restarts. Should your changes be forgotten, or should whatever change you make be permanent? Following the direction a major package went is a fine choice. Web servers (apache, lighttpd, nginx, etc) all pretty much operate only off of config files, and if you want a change to the config to take effect, you need to restart the daemon. Re-parsing a config file while running seems fishy to me.
When it comes to config, I find the best types of config are the ones that are easy for real people to understand, instead of ones that are made for computers. So yaml is acceptable, but not really ideal. toml is currently my favorite format for this, as it supports nested groupings, without being strict about data types.
When it comes to communicating with a long running process, the main question you should ask yourself is what you want it to do if it restarts. Should your changes be forgotten, or should whatever change you make be permanent? Following the direction a major package went is a fine choice. Web servers (apache, lighttpd, nginx, etc) all pretty much operate only off of config files, and if you want a change to the config to take effect, you need to restart the daemon. Re-parsing a config file while running seems fishy to me.