micro/registry/memory/memory_watcher.go
Vasiliy Tolstov a1eaf9cc20 linting fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2019-12-04 00:22:02 +03:00

28 lines
412 B
Go

package memory
import (
"errors"
"github.com/micro/go-micro/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)
}
}