RCManager handles a group of root-chain sock clients
| 32 | |
| 33 | // RCManager handles a group of root-chain sock clients |
| 34 | type RCManager struct { |
| 35 | c lib.Config // the global node config |
| 36 | controller *controller.Controller // reference to controller for state access |
| 37 | subscriptions map[uint64]*RCSubscription // chainId -> subscription |
| 38 | subscribers map[uint64][]*RCSubscriber // chainId -> subscribers |
| 39 | l *sync.Mutex // thread safety |
| 40 | afterRCUpdate func(info *lib.RootChainInfo) // callback after the root chain info update |
| 41 | upgrader websocket.Upgrader // upgrade http connection to ws |
| 42 | log lib.LoggerI // stdout log |
| 43 | // rc subscriber limits |
| 44 | rcSubscriberReadLimitBytes int64 |
| 45 | rcSubscriberWriteTimeout time.Duration |
| 46 | rcSubscriberPongWait time.Duration |
| 47 | rcSubscriberPingPeriod time.Duration |
| 48 | maxRCSubscribers int |
| 49 | maxRCSubscribersPerChain int |
| 50 | subscriberCount int |
| 51 | } |
| 52 | |
| 53 | // NewRCManager() constructs a new instance of a RCManager |
| 54 | func NewRCManager(controller *controller.Controller, config lib.Config, logger lib.LoggerI) (manager *RCManager) { |
nothing calls this directly
no outgoing calls
no test coverage detected