MCPcopy
hub / github.com/canopy-network/canopy / RCManager

Struct RCManager

cmd/rpc/sock.go:34–51  ·  view source on GitHub ↗

RCManager handles a group of root-chain sock clients

Source from the content-addressed store, hash-verified

32
33// RCManager handles a group of root-chain sock clients
34type 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
54func NewRCManager(controller *controller.Controller, config lib.Config, logger lib.LoggerI) (manager *RCManager) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected