Skip to content

Commit

Permalink
ResourceWatcher done and LoadStore stop
Browse files Browse the repository at this point in the history
  • Loading branch information
purnesh42H committed Feb 25, 2025
1 parent 07c5597 commit 20371b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions xds/internal/clients/lrsclient/load_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ type PerClusterReporter interface {
// CallDropped records a call dropped in the LoadStore.
CallDropped(category string)
}

// Stop stops the LoadStore's load reporting stream.
func (ls *LoadStore) Stop() error {
panic("unimplemented")

Check warning on line 56 in xds/internal/clients/lrsclient/load_store.go

View check run for this annotation

Codecov / codecov/patch

xds/internal/clients/lrsclient/load_store.go#L55-L56

Added lines #L55 - L56 were not covered by tests
}
15 changes: 7 additions & 8 deletions xds/internal/clients/xdsclient/resource_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@ package xdsclient
// corresponding to the resource being watched. gRFC A88 contains an exhaustive
// list of what method is invoked under what conditions.
//
// changeProcessed and errorProcessed in the callbacks are functions to be
// invoked by resource watcher implementations upon completing the processing
// of a callback from the xDS client for change and error respectively. Failure
// to invoke this callback prevents the xDS client from reading further
// messages from the xDS server.
// done() in the callbacks is a function to be invoked by resource watcher
// implementations upon completing the processing of a callback from the xDS
// client for change and error respectively. Failure to invoke this callback
// prevents the xDS client from reading further messages from the xDS server.
type ResourceWatcher interface {
// ResourceChanged indicates a new version of the resource is available.
ResourceChanged(resourceData ResourceData, changeProcessed func())
ResourceChanged(resourceData ResourceData, done func())

// ResourceError indicates an error occurred while trying to fetch or
// decode the associated resource. The previous version of the resource
// should be considered invalid.
ResourceError(err error, errorProcessed func())
ResourceError(err error, done func())

// AmbientError indicates an error occurred after a resource has been
// received that should not modify the use of that resource but may be
// provide useful information about the ambient state of the XDSClient for
// debugging purposes. The previous version of the resource should still be
// considered valid.
AmbientError(err error, errorProcessed func())
AmbientError(err error, done func())
}

0 comments on commit 20371b4

Please sign in to comment.