On Apr 10, 2008, at 4:22 PM, Daniel Yokomizo wrote:
A couple of thoughts.

1. Why not use the usual Erlang approach for code update, using the
loop for receiving messages and handling config updates, it seems
cleaner and a better fit. This way you need only a single process to
handle the config file format and notify the rest.


That's pretty much what I was describing. By registering a callback with the config module, you can send yourself a message when a relevant change takes effect, then act on it.


2. Also it would be simpler to have almost every config inside a
CouchDB database, so you startup using the default config and the
config process reads the database for the real config info and
notifies the other modules of the actual values. With this in place
it'll be easier to have other config formats in the future: just make
some module that understands format foo and writes/reads it to/from
couchdb. The config process will see the changes and propagate them.



IME it's better to keep config files away from the core of some
application and let some external agent interpret the files and
configure the application using an api.

Interesting.


Reply via email to