( namespaceIDToName NamespaceIDToNameFunc, timeout time.Duration, longPollTimeout time.Duration, )
| 119 | } |
| 120 | |
| 121 | func (cf *rpcClientFactory) NewMatchingClientWithTimeout( |
| 122 | namespaceIDToName NamespaceIDToNameFunc, |
| 123 | timeout time.Duration, |
| 124 | longPollTimeout time.Duration, |
| 125 | ) (matchingservice.MatchingServiceClient, error) { |
| 126 | resolver, err := cf.monitor.GetResolver(primitives.MatchingService) |
| 127 | if err != nil { |
| 128 | return nil, err |
| 129 | } |
| 130 | |
| 131 | keyResolver := newServiceKeyResolver(resolver) |
| 132 | clientProvider := func(clientKey string) (any, func() error, error) { |
| 133 | connection := cf.rpcFactory.CreateMatchingGRPCConnection(clientKey) |
| 134 | return matchingservice.NewMatchingServiceClient(connection), connection.Close, nil |
| 135 | } |
| 136 | client := matching.NewClient( |
| 137 | timeout, |
| 138 | longPollTimeout, |
| 139 | common.NewClientCache(keyResolver, clientProvider, cf.logger), |
| 140 | cf.metricsHandler, |
| 141 | cf.logger, |
| 142 | matching.NewLoadBalancer(namespaceIDToName, cf.dynConfig, cf.testHooks), |
| 143 | dynamicconfig.MatchingSpreadRoutingBatchSize.Get(cf.dynConfig), |
| 144 | resolver, |
| 145 | dynamicconfig.MatchingConnectionCloseDelay.Get(cf.dynConfig), |
| 146 | ) |
| 147 | |
| 148 | if cf.metricsHandler != nil { |
| 149 | client = matching.NewMetricClient(client, cf.metricsHandler, cf.logger, cf.throttledLogger) |
| 150 | } |
| 151 | return client, nil |
| 152 | |
| 153 | } |
| 154 | |
| 155 | func (cf *rpcClientFactory) NewRemoteFrontendClientWithTimeout( |
| 156 | rpcAddress string, |
nothing calls this directly
no test coverage detected