MCPcopy Create free account
hub / github.com/temporalio/temporal / NewMatchingClientWithTimeout

Method NewMatchingClientWithTimeout

client/clientfactory.go:121–153  ·  view source on GitHub ↗
(
	namespaceIDToName NamespaceIDToNameFunc,
	timeout time.Duration,
	longPollTimeout time.Duration,
)

Source from the content-addressed store, hash-verified

119}
120
121func (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
155func (cf *rpcClientFactory) NewRemoteFrontendClientWithTimeout(
156 rpcAddress string,

Callers

nothing calls this directly

Calls 8

NewClientFunction · 0.92
NewClientCacheFunction · 0.92
NewLoadBalancerFunction · 0.92
NewMetricClientFunction · 0.92
newServiceKeyResolverFunction · 0.85
GetResolverMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected