application architecture

Nicholas Leippe nick at leippe.com
Mon Jan 7 09:11:30 MST 2008


On Monday 07 January 2008, Nicholas Leippe wrote:
> On Saturday 05 January 2008, Doran L. Barton wrote:
> > Your idea of modifying the configuration file and sending a signal to the
> > main program to re-read its configuration is the first idea I had as I
> > was reading your message. I wonder how much trouble it would be to simply
> > add a periodic check in the main program to monitor the configuration
> > file for changes. Without knowing the nature of the program, I can't
> > really offer any advice on whether that would be a good approach or not
> > but it might be something to consider.
>
> I would recommend requiring a signal. You don't want the program to pick up
> partial changes that might occur if you're messing around with the file by
> hand...  Besides, polling is evil ;)
>

However, if you were to implement a policy that guaranteed that the file is 
always complete (such as replacing the file rather than modifying it 
in-place), you could use inotify in the application to monitor it (w/o 
polling), and no longer need to signal it.






More information about the PLUG mailing list