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

Method createInternodeGRPCConnection

common/rpc/rpc.go:270–282  ·  view source on GitHub ↗

createInternodeGRPCConnection creates connection for gRPC calls

(hostName string, serviceName primitives.ServiceName)

Source from the content-addressed store, hash-verified

268
269// createInternodeGRPCConnection creates connection for gRPC calls
270func (d *RPCFactory) createInternodeGRPCConnection(hostName string, serviceName primitives.ServiceName) *grpc.ClientConn {
271 var tlsClientConfig *tls.Config
272 var err error
273 if d.tlsFactory != nil {
274 tlsClientConfig, err = d.tlsFactory.GetInternodeClientConfig()
275 if err != nil {
276 d.logger.Fatal("Failed to create tls config for gRPC connection", tag.Error(err))
277 return nil
278 }
279 }
280 additionalDialOptions := append([]grpc.DialOption{}, d.perServiceDialOptions[serviceName]...)
281 return d.dial(hostName, tlsClientConfig, append(additionalDialOptions, d.getClientKeepAliveConfig(serviceName))...)
282}
283
284func (d *RPCFactory) CreateHistoryGRPCConnection(rpcAddress string) *grpc.ClientConn {
285 return d.createInternodeGRPCConnection(rpcAddress, primitives.HistoryService)

Callers 2

Implementers 4

MockRPCFactorycommon/rpc_mock.go
MockRPCFactoryMockRecordercommon/rpc_mock.go
RPCFactorycommon/rpc/rpc.go
RPCFactorycommon/testing/nettest/rpc_factory.go

Calls 5

dialMethod · 0.95
ErrorFunction · 0.92
FatalMethod · 0.65

Tested by

no test coverage detected