How to stop file watcher?
halturin opened this issue · comments
Taras Halturin commented
couldn't find a way to stop file-watching.
f := file.Provider("somefile.yaml"))
f.Watch(func(event any, e error) error {
// handler
}
am I missing something?
Kailash Nadh commented
You're right, there's no way to currently stop watching files. Please feel free to send a PR. Perhaps an f.Unwatch()
.
Taras Halturin commented
not sure if I have enough spare time in the near future. but if I implemented this feature, I would update the Provider
interface by adding
Watch(func(...) error) error // returns error if doesn't support
Unwatch() error // same here
methods to make it more unified
prateek-narsinghani commented