1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
go-micro/registry/mock/mock_watcher.go
2016-04-26 18:32:43 +01:00

29 lines
396 B
Go

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