Skip to content

Commit

Permalink
Remove unused NewFrontendClient functions (cadence-workflow#4553)
Browse files Browse the repository at this point in the history
  • Loading branch information
vytautas-karpavicius authored Oct 11, 2021
1 parent 19a954a commit 7a6b851
Showing 1 changed file with 0 additions and 32 deletions.
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

0 comments on commit 7a6b851

Please sign in to comment.