unsubscribe a subscription. If the subscription could not be found ErrSubscriptionNotFound is returned.
(id ID)
| 110 | // unsubscribe a subscription. |
| 111 | // If the subscription could not be found ErrSubscriptionNotFound is returned. |
| 112 | func (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 |