jdiazcano / cfg4k

Flexible and easy to use config library written in kotlin
Apache License 2.0
80 stars 6 forks source link

Make TimedReloadStrategy error-prone and reusable #44

Closed detouched closed 6 years ago

detouched commented 6 years ago

Current TimedReloadStrategy has two flaws:

This change makes TimedReloadStrategy use a scheduled executor service with error-prone reload() call to prevent subsequent reload attempts from auto-cancelling, and use a map of ConfigProviders to register and unregister them properly.

detouched commented 6 years ago

The build is failing due to some openssl pre-configuration failure, not sure how to fix that but I guess it's unrelated to the proposed change.

jdiazcano commented 6 years ago

@detouched Hello!

Thanks for taking your time of doing this!.

The build is failing because the test that executes the Git checkout via SSH can't be decrypted with the pull requests that aren't coming from me. This is something I really need to check. But it is totally unrelated, it is due on how travis-ci works with encrypted files.

I'm leaving some comments before pulling it in but I like the shape of it.

detouched commented 6 years ago

Thanks for the quick reply :)

Sorry again that I wasn't looking at the up-to-date source code while making the change, my bad. I'll drop the try-catch and the corresponding test, as well as the unused variable and update this PR.