|
|
@ -20,12 +20,12 @@ type Discovery interface { |
|
|
|
|
|
|
|
|
|
|
|
// Watcher is service watcher.
|
|
|
|
// Watcher is service watcher.
|
|
|
|
type Watcher interface { |
|
|
|
type Watcher interface { |
|
|
|
// Watch returns services in the following two cases:
|
|
|
|
// Next returns services in the following two cases:
|
|
|
|
// 1.the first time to watch and the service instance list is not empty.
|
|
|
|
// 1.the first time to watch and the service instance list is not empty.
|
|
|
|
// 2.any service instance changes found.
|
|
|
|
// 2.any service instance changes found.
|
|
|
|
// if the above two conditions are not met, it will block until context deadline exceeded or canceled
|
|
|
|
// if the above two conditions are not met, it will block until context deadline exceeded or canceled
|
|
|
|
Next() ([]*ServiceInstance, error) |
|
|
|
Next() ([]*ServiceInstance, error) |
|
|
|
// Close close the watcher.
|
|
|
|
// Stop close the watcher.
|
|
|
|
Stop() error |
|
|
|
Stop() error |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|