howech/gestalt

Jitter in ConfigFile change detection.

Closed this issue · 1 comments

When I set up a ConfigFile object to watch a file, and then edit it with either vi or emacs, I get multiple 'loaded' events after the file has been saved. I suspect that the configFile object is reacting to a series of low-level events that happen in the course of saving the file.

Maybe there should be a small delay between seeing a change to a file and actually loading it to make sure that whatever is making changes is really done.

I fixed the example by adding some state to the model - seems to fix the behavior, not sure if it is reading the files repeatedly when this scenario happens, though.