1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-24 22:26:54 +02:00
Files
go-micro/plugins/registry/memory/memory_watcher.go
2021-01-20 21:01:10 +00:00

28 lines
414 B
Go

package memory
import (
"errors"
"github.com/asim/go-micro/v3/registry"
)
type memoryWatcher struct {
exit chan bool
opts registry.WatchOptions
}
func (m *memoryWatcher) Next() (*registry.Result, error) {
// not implement so we just block until exit
<-m.exit
return nil, errors.New("watcher stopped")
}
func (m *memoryWatcher) Stop() {
select {
case <-m.exit:
return
default:
close(m.exit)
}
}