MCPcopy
hub / github.com/grpc/grpc-go / init

Function init

clientconn.go:778–794  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

776var emptyServiceConfig *ServiceConfig
777
778func init() {
779 cfg := parseServiceConfig("{}", defaultMaxCallAttempts)
780 if cfg.Err != nil {
781 panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err))
782 }
783 emptyServiceConfig = cfg.Config.(*ServiceConfig)
784
785 internal.SubscribeToConnectivityStateChanges = func(cc *ClientConn, s grpcsync.Subscriber) func() {
786 return cc.csMgr.pubSub.Subscribe(s)
787 }
788 internal.EnterIdleModeForTesting = func(cc *ClientConn) {
789 cc.idlenessMgr.EnterIdleModeForTesting()
790 }
791 internal.ExitIdleModeForTesting = func(cc *ClientConn) {
792 cc.idlenessMgr.ExitIdleMode()
793 }
794}
795
796func (cc *ClientConn) maybeApplyDefaultServiceConfig() {
797 if cc.sc != nil {

Callers

nothing calls this directly

Calls 4

SubscribeMethod · 0.80
parseServiceConfigFunction · 0.70
ExitIdleModeMethod · 0.65

Tested by

no test coverage detected