Skip to content

Commit

Permalink
Add a ResourceLocator interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Mar 22, 2023
1 parent 1439b87 commit 92ebca6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/membership/interfaces.go
Expand Up @@ -79,7 +79,7 @@ type (
// ServiceResolver provides membership information for a specific temporal service.
// It can be used to resolve which member host is responsible for serving a given key.
ServiceResolver interface {
Lookup(key string) (HostInfo, error)
ResourceLocator
// AddListener adds a listener which will get notified on the given
// channel, whenever membership changes.
// @name: The name for identifying the listener
Expand All @@ -95,6 +95,12 @@ type (
RequestRefresh()
}

// ResourceLocator provides the mapping of resources to hosts
ResourceLocator interface {
// Lookup locates the host of the resource with the given key
Lookup(key string) (HostInfo, error)
}

HostInfoProvider interface {
Start() error
HostInfo() HostInfo
Expand Down
38 changes: 38 additions & 0 deletions common/membership/interfaces_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 92ebca6

Please sign in to comment.