the configuration source
the optional fallback reloader
the period of time during which changes will be ignored. Use zero for detecting every external change immediately; this may be expensive because a lock has to be acquired and released. Use a much larger number to reduce the frequency of checking and hence the amount of thread locking.
a callback that is invoked as a side-effect of calling config
whenever a reload happens. It happens
on first-time initialisation and again on every subsequent reload.
The callback may have been called from any of the reloaders in the chain. It is passed the source,
to identify which reloader changed, and the new config from that source (if the reloader in question
is not at the head of then reloader chain, the new config will not be the same as would be returned
from that reloader).
Gets the current configuration.
Gets the current configuration. On occasions, the underlying file (if any) will be checked and may be reloaded.
Do not store the result of this method in a long-lived val
because that is likely to defeat the reloading.
Wraps uk.co.bigbeeconsultants.bconfig.Config loading so that changes to the source can be reloaded dynamically. All subsequent access to the configuration should be via the
config
method, which will ensure that changes are automatically reloaded from disk (or wherever) in a timely way.It is safe to share reloaders between multiple calling threads.