1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-29 18:04:17 +02:00
go-micro/plugins/registry/memory/memory_watcher.go
2021-10-12 12:55:53 +01:00

28 lines
402 B
Go

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