1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/registry/memory/memory_watcher.go
2019-01-14 15:27:25 +00:00

30 lines
432 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
select {
case <-m.exit:
return nil, errors.New("watcher stopped")
}
}
func (m *memoryWatcher) Stop() {
select {
case <-m.exit:
return
default:
close(m.exit)
}
}