MCPcopy Create free account
hub / github.com/CPChain/chain / activate

Method activate

api/rpc/subscription.go:127–135  ·  view source on GitHub ↗

activate enables a subscription. Until a subscription is enabled all notifications are dropped. This method is called by the RPC server after the subscription ID was sent to client. This prevents notifications being send to the client before the subscription ID is send to the client.

(id ID, namespace string)

Source from the content-addressed store, hash-verified

125// the subscription ID was sent to client. This prevents notifications being
126// send to the client before the subscription ID is send to the client.
127func (n *Notifier) activate(id ID, namespace string) {
128 n.subMu.Lock()
129 defer n.subMu.Unlock()
130 if sub, found := n.inactive[id]; found {
131 sub.namespace = namespace
132 n.active[id] = sub
133 delete(n.inactive, id)
134 }
135}

Callers 1

handleMethod · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected