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

Method CurrentState

balancer/conn_state_evaluator.go:62–74  ·  view source on GitHub ↗

CurrentState returns the current aggregate conn state by evaluating the counters

()

Source from the content-addressed store, hash-verified

60
61// CurrentState returns the current aggregate conn state by evaluating the counters
62func (cse *ConnectivityStateEvaluator) CurrentState() connectivity.State {
63 // Evaluate.
64 if cse.numReady > 0 {
65 return connectivity.Ready
66 }
67 if cse.numConnecting > 0 {
68 return connectivity.Connecting
69 }
70 if cse.numIdle > 0 {
71 return connectivity.Idle
72 }
73 return connectivity.TransientFailure
74}

Callers 3

RecordTransitionMethod · 0.95
buildMethod · 0.80
buildLockedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected