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)
| 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. |
| 127 | func (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 | } |