ConsenSysMesh / cava

ConsenSys core libraries for Java & Kotlin
Apache License 2.0
84 stars 34 forks source link

Ability to listen to config files and reload the config whenever it changes #21

Closed atoulme closed 6 years ago

atoulme commented 6 years ago

This adds the ability to provide a consumer that is called with a new copy of the configuration whenever the file is changed. This is relying on the JDK's WatchService API, which uses polling (with a default polling interval of 10s) to listen to file system changes. This functionality is decoupled between config and a new method in the io module that allows listening to file changes. The tests added for this functionality are slow, as polling intervals cannot always be shortened. To make sure developers don't experience slow builds on their local machines, the tests are tagged with the slow tag and ignored when the "dev" task runs.