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

Method unsubscribe

api/rpc/subscription.go:112–121  ·  view source on GitHub ↗

unsubscribe a subscription. If the subscription could not be found ErrSubscriptionNotFound is returned.

(id ID)

Source from the content-addressed store, hash-verified

110// unsubscribe a subscription.
111// If the subscription could not be found ErrSubscriptionNotFound is returned.
112func (n *Notifier) unsubscribe(id ID) error {
113 n.subMu.Lock()
114 defer n.subMu.Unlock()
115 if s, found := n.active[id]; found {
116 close(s.err)
117 delete(n.active, id)
118 return nil
119 }
120 return ErrSubscriptionNotFound
121}
122
123// activate enables a subscription. Until a subscription is enabled all
124// notifications are dropped. This method is called by the RPC server after

Callers 1

handleMethod · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected