router represents an RPC router.
| 53 | |
| 54 | // router represents an RPC router. |
| 55 | type router struct { |
| 56 | ops RouterOptions |
| 57 | |
| 58 | serviceMap map[string]*service |
| 59 | |
| 60 | freeReq *request |
| 61 | |
| 62 | freeResp *response |
| 63 | |
| 64 | subscribers map[string][]*subscriber |
| 65 | |
| 66 | // handler wrappers |
| 67 | hdlrWrappers []HandlerWrapper |
| 68 | // subscriber wrappers |
| 69 | subWrappers []SubscriberWrapper |
| 70 | |
| 71 | su sync.RWMutex |
| 72 | |
| 73 | mu sync.Mutex // protects the serviceMap |
| 74 | |
| 75 | reqLock sync.Mutex // protects freeReq |
| 76 | |
| 77 | respLock sync.Mutex // protects freeResp |
| 78 | } |
| 79 | |
| 80 | // rpcRouter encapsulates functions that become a Router. |
| 81 | type rpcRouter struct { |
nothing calls this directly
no outgoing calls
no test coverage detected