with Auto Reload
Starts a file watcher that automatically reloads the config when the file is modified on disk.
Changes are debounced — rapid successive writes trigger only one reload. If the new config differs, all onChange listeners are notified.
val config = YamlConfigManager.ref<DuelsConfig>(file)
.withAutoReload()
.onChange { _, new -> logger.info("Reloaded: ${new.serverId}") }Content copied to clipboard
Return
This ConfigRef for chaining.
Since
1.0
Parameters
debounce Ms
Debounce interval in milliseconds. Defaults to 500.