mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-18 08:26:38 +02:00
d94936f6c9
* v3 * revert plugins * fixup some issues
24 lines
371 B
Go
24 lines
371 B
Go
package memory
|
|
|
|
import (
|
|
"github.com/asim/go-micro/v3/config/source"
|
|
)
|
|
|
|
type watcher struct {
|
|
Id string
|
|
Updates chan *source.ChangeSet
|
|
Source *memory
|
|
}
|
|
|
|
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
|
|
}
|