initServerWorkers creates worker goroutines and a channel to process incoming connections to reduce the time spent overall on runtime.morestack.
()
| 690 | // initServerWorkers creates worker goroutines and a channel to process incoming |
| 691 | // connections to reduce the time spent overall on runtime.morestack. |
| 692 | func (s *Server) initServerWorkers() { |
| 693 | s.serverWorkerChannel = make(chan func()) |
| 694 | s.serverWorkerChannelClose = sync.OnceFunc(func() { |
| 695 | close(s.serverWorkerChannel) |
| 696 | }) |
| 697 | for i := uint32(0); i < s.opts.numServerWorkers; i++ { |
| 698 | go s.serverWorker() |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | // NewServer creates a gRPC server which has no service registered and has not |
| 703 | // started to accept requests yet. |
no test coverage detected