code: func (lb *LogBroker) watchSubscriptions(nodeID string) ([]*subscription, chan events.Event, func()) {
  	lb.mu.RLock()
  	defer lb.mu.RUnlock()
  
  	// Watch for subscription changes for this node.
  	ch, cancel := lb.subscriptionQueue.CallbackWatch(events.MatcherFunc(func(event events.Event) bool {
  		s := event.(*subscription)
  		return s.Contains(nodeID)
  	}))
  
  	// Grab current subscriptions.
  	var subscriptions []*subscription
  	for _, s := range lb.registeredSubscriptions {
  		if s.Contains(nodeID) {
  			subscriptions = append(subscriptions, s)
  		}
  	}
  
  	return subscriptions, ch, cancel
  }
docs: // watchSubscriptions grabs all current subscriptions and notifies of any
  // subscription change for this node.
  //
  // Subscriptions may fire multiple times and the caller has to protect against
  // dupes.