Server is a gRPC server to serve RPC requests.
| 126 | |
| 127 | // Server is a gRPC server to serve RPC requests. |
| 128 | type Server struct { |
| 129 | opts serverOptions |
| 130 | statsHandler stats.Handler |
| 131 | |
| 132 | mu sync.Mutex // guards following |
| 133 | lis map[net.Listener]bool |
| 134 | // conns contains all active server transports. It is a map keyed on a |
| 135 | // listener address with the value being the set of active transports |
| 136 | // belonging to that listener. |
| 137 | conns map[string]map[transport.ServerTransport]bool |
| 138 | serve bool |
| 139 | drain bool |
| 140 | cv *sync.Cond // signaled when connections close for GracefulStop |
| 141 | services map[string]*serviceInfo // service name -> service info |
| 142 | events traceEventLog |
| 143 | |
| 144 | quit *grpcsync.Event |
| 145 | done *grpcsync.Event |
| 146 | channelzRemoveOnce sync.Once |
| 147 | serveWG sync.WaitGroup // counts active Serve goroutines for Stop/GracefulStop |
| 148 | handlersWG sync.WaitGroup // counts active method handler goroutines |
| 149 | |
| 150 | channelz *channelz.Server |
| 151 | |
| 152 | serverWorkerChannel chan func() |
| 153 | serverWorkerChannelClose func() |
| 154 | } |
| 155 | |
| 156 | type serverOptions struct { |
| 157 | creds credentials.TransportCredentials |
nothing calls this directly
no outgoing calls
no test coverage detected