Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused NewFrontendClient functions #4553

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove unused NewFrontendClient functions
  • Loading branch information
vytautas-karpavicius committed Oct 8, 2021
commit 4c0cd8f79c83479b4667a1657fe1af2fdb7644bf
32 changes: 0 additions & 32 deletions client/clientfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ type (
Factory interface {
NewHistoryClient() (history.Client, error)
NewMatchingClient(domainIDToName DomainIDToNameFunc) (matching.Client, error)
NewFrontendClient() (frontend.Client, error)

NewHistoryClientWithTimeout(timeout time.Duration) (history.Client, error)
NewMatchingClientWithTimeout(domainIDToName DomainIDToNameFunc, timeout time.Duration, longPollTimeout time.Duration) (matching.Client, error)
NewFrontendClientWithTimeout(timeout time.Duration, longPollTimeout time.Duration) (frontend.Client, error)

NewAdminClientWithTimeoutAndConfig(config transport.ClientConfig, timeout time.Duration, largeTimeout time.Duration) (admin.Client, error)
NewFrontendClientWithTimeoutAndConfig(config transport.ClientConfig, timeout time.Duration, longPollTimeout time.Duration) (frontend.Client, error)
Expand Down Expand Up @@ -117,10 +115,6 @@ func (cf *rpcClientFactory) NewMatchingClient(domainIDToName DomainIDToNameFunc)
return cf.NewMatchingClientWithTimeout(domainIDToName, matching.DefaultTimeout, matching.DefaultLongPollTimeout)
}

func (cf *rpcClientFactory) NewFrontendClient() (frontend.Client, error) {
return cf.NewFrontendClientWithTimeout(frontend.DefaultTimeout, frontend.DefaultLongPollTimeout)
}

func (cf *rpcClientFactory) createKeyResolver(serviceName string) (func(key string) (string, error), error) {
resolver, err := cf.monitor.GetResolver(serviceName)
if err != nil {
Expand Down Expand Up @@ -239,32 +233,6 @@ func (cf *rpcClientFactory) NewMatchingClientWithTimeout(

}

func (cf *rpcClientFactory) NewFrontendClientWithTimeout(
timeout time.Duration,
longPollTimeout time.Duration,
) (frontend.Client, error) {
keyResolver, err := cf.createKeyResolver(service.Frontend)
if err != nil {
return nil, err
}

clientProvider := func(clientKey string) (interface{}, error) {
if cf.enableGRPCOutbound {
return cf.newFrontendGRPCClient(clientKey)
}
return cf.newFrontendThriftClient(clientKey)
}

client := frontend.NewClient(timeout, longPollTimeout, common.NewClientCache(keyResolver, clientProvider))
if errorRate := cf.dynConfig.GetFloat64Property(dynamicconfig.FrontendErrorInjectionRate, 0)(); errorRate != 0 {
client = frontend.NewErrorInjectionClient(client, errorRate, cf.logger)
}
if cf.metricsClient != nil {
client = frontend.NewMetricClient(client, cf.metricsClient)
}
return client, nil
}

func (cf *rpcClientFactory) NewAdminClientWithTimeoutAndConfig(
config transport.ClientConfig,
timeout time.Duration,
Expand Down