| 27 | ) |
| 28 | |
| 29 | type rpcServer struct { |
| 30 | opts Options |
| 31 | // Subscribe to service name |
| 32 | subscriber broker.Subscriber |
| 33 | // Goal: |
| 34 | // router Router |
| 35 | router *router |
| 36 | exit chan chan error |
| 37 | |
| 38 | handlers map[string]Handler |
| 39 | subscribers map[Subscriber][]broker.Subscriber |
| 40 | // Graceful exit |
| 41 | wg *sync.WaitGroup |
| 42 | // Cached service |
| 43 | rsvc *registry.Service |
| 44 | |
| 45 | sync.RWMutex |
| 46 | // Marks the serve as started |
| 47 | started bool |
| 48 | // Used for first registration |
| 49 | registered bool |
| 50 | } |
| 51 | |
| 52 | // NewRPCServer will create a new default RPC server. |
| 53 | func NewRPCServer(opts ...Option) Server { |
nothing calls this directly
no outgoing calls
no test coverage detected