1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-06 22:06:19 +02:00

24 lines
359 B
Go
Raw Permalink Normal View History

2019-05-30 23:11:13 +01:00
package memory
import (
2024-06-04 21:40:43 +01:00
"go-micro.dev/v5/config/source"
2019-05-30 23:11:13 +01:00
)
type watcher struct {
Updates chan *source.ChangeSet
Source *memory
2023-04-26 00:16:34 +00:00
Id string
2019-05-30 23:11:13 +01:00
}
func (w *watcher) Next() (*source.ChangeSet, error) {
cs := <-w.Updates
return cs, nil
}
func (w *watcher) Stop() error {
w.Source.Lock()
delete(w.Source.Watchers, w.Id)
w.Source.Unlock()
return nil
}