func (b *BIZ) watchIslbNodes(state discovery.NodeState, id string, node *discovery.Node) {
	b.nodeLock.Lock()
	defer b.nodeLock.Unlock()

	if state == discovery.NodeStateUp {
		if _, found := b.nodes[id]; !found {
			b.nodes[id] = *node
		}
		if _, found := b.subs[id]; !found {
			b.subIslbBroadcast(*node)
		}
	} else if state == discovery.NodeStateDown {
		if sub := b.subs[id]; sub != nil {
			if err := sub.Unsubscribe(); err != nil {
				log.Errorf("unsubscribe %s error: %v", sub.Subject, err)
			}
		}
		delete(b.subs, id)
		delete(b.nodes, id)
	}
}
// watchNodes watch islb nodes up/down
watchNodes watch islb nodes up/down
// watchNodes watch islb nodes up / down
func (b *BIZ) watchIslbNodes(state discovery.NodeState, id string, node *discovery.Node) {
	b.nodeLock.Lock()
	defer b.nodeLock.Unlock()
	if state == discovery.NodeStateUp {
		if _, found := b.nodes[id]; !found {
			b.nodes[id] = *node
		}
		if _, found := b.subs[id]; !found {
			b.subIslbBroadcast(*node)
		}
	} else if state == discovery.NodeStateDown {
		if sub := b.subs[id]; sub != nil {
			if err := sub.Unsubscribe(); err != nil {
				log.Errorf("unsubscribe %s error: %v", sub.Subject, err)
			}
		}
		delete(b.subs, id)
		delete(b.nodes, id)
	}
}
func ( b * BIZ ) watchIslbNodes ( state discovery . NodeState , id string , node * discovery . Node ) { b . nodeLock . Lock ( ) defer b . nodeLock . Unlock ( ) if state == discovery . NodeStateUp { if _ , found := b . nodes [ id ] ; ! found { b . nodes [ id ] = * node } if _ , found := b . subs [ id ] ; ! found { b . subIslbBroadcast ( * node ) } } else if state == discovery . NodeStateDown { if sub := b . subs [ id ] ; sub != nil { if err := sub . Unsubscribe ( ) ; err != nil { log . Errorf ( " " , sub . Subject , err ) } } delete ( b . subs , id ) delete ( b . nodes , id ) } }
watchNodes watch islb nodes up/down
watchNodes watch islb nodes up / down