// NotifyLeave is invoked when a node is detected to have left.
// The Node argument must not be modified.
961386
func (gd *GossipDelegate) NotifyLeave(node *memberlist.Node) {
	nodeName := gd.parseMemberlistNodeName(node.Name)
	if nodeName == gd.nodeId {
		gd.triggerStateEvent(types.SELF_LEAVE)
	} else {
		if gd.quorumProvider.Type() == types.QUORUM_PROVIDER_FAILURE_DOMAINS {
			go func() {
				isSuspect := gd.isClusterDomainSuspectDown(types.NodeId(nodeName))
				if isSuspect {
					gd.setNodeAsSuspectOffline(nodeName)
				} else {
					gd.setNodeOffline(nodeName)
				}
			}()
		} else {
			gd.setNodeOffline(nodeName)
		}
	}

	gd.updateGossipTs()
	return
}
781569
func (s *SubscriptionProvider) Notify(event interface{}) {
	s.RLock()
	defer s.RUnlock()
	for _, sub := range s.subscriptions {
		if err := sub.notify(event); err != nil {
			Log.Warnf("Failed notifying subscription (%s): %s", sub.id, err)
		}
	}
}
348770
func (s *Notification) SetNotifyAll(v bool) *Notification {
	s.NotifyAll = &v
	return s
}
595158
func (p *Project) Notify(eventType events.EventType, serviceName string, data map[string]string) {
	if eventType == events.NoEvent {
		return
	}

	event := events.Event{
		EventType:   eventType,
		ServiceName: serviceName,
		Data:        data,
	}

	for _, l := range p.listeners {
		l <- event
	}
}
114351
func NotifyDepth(depth uint8, kad *Kademlia) {
	f := func(val *Peer, po int) bool {
		val.NotifyDepth(depth)
		return true
	}
	kad.EachConn(nil, 255, f)
}
453845
func (b *Listeners) Notify() {
	b.Lock()
	defer b.Unlock()
	for _, notify := range b.listeners {
		notify()
	}
}
142922
func (c *Conn) notify(method string, data []byte) {
	c.streamMu.Lock()
	stream := c.streams[method]
	c.streamMu.Unlock()

	if stream != nil {
		// Stream writer must be able to handle incoming writes
		// even after it has been removed (unsubscribed).
		stream.write(method, data)
	}
}
835672
func Notify(ctx context.Context, subj, msg string) error {
	if os.Getenv("GOPASS_NO_NOTIFY") != "" || !ctxutil.IsNotifications(ctx) {
		return nil
	}
	osas, err := exec.LookPath("osascript")
	if err != nil {
		return err
	}

	return exec.Command(
		osas,
		"-e",
		`display notification "`+msg+`" with title "`+subj+`"`,
	).Start()
}
680561
func (s *Swarm) Notify(f inet.Notifiee) {
	s.notifs.Lock()
	s.notifs.m[f] = struct{}{}
	s.notifs.Unlock()
}
236619
func (ps *peerSet) notify(n peerSetNotify) {
	ps.lock.Lock()
	ps.notifyList = append(ps.notifyList, n)
	peers := make([]*peer, 0, len(ps.peers))
	for _, p := range ps.peers {
		peers = append(peers, p)
	}
	ps.lock.Unlock()

	for _, p := range peers {
		n.registerPeer(p)
	}
}
339343
func (e *EventListener) Notify(event *ct.Event) {
	e.subMtx.RLock()
	defer e.subMtx.RUnlock()
	if subs, ok := e.subscribers[event.AppID]; ok {
		for sub := range subs {
			sub.Notify(event)
		}
	}
	if event.AppID != "" {
		// Ensure subscribers not filtering by app get the event
		if subs, ok := e.subscribers[""]; ok {
			for sub := range subs {
				sub.Notify(event)
			}
		}
	}
}
582385
func (b *Broadcaster) Notify(instance interface{}) {
	b.listenerLock.RLock()
	listeners := b.listeners
	b.listenerLock.RUnlock()
	for _, listener := range listeners {
		listener.OnUpdate(instance)
	}
}
741841
func (c *BitcoindClient) NotifyReceived(addrs []btcutil.Address) error {
	c.NotifyBlocks()

	select {
	case c.rescanUpdate <- addrs:
	case <-c.quit:
		return ErrBitcoindClientShuttingDown
	}

	return nil
}
775632
func (cfg *dynamicTLSConfig) notify() {
	if cfg.readyCh != nil && cfg.leaf != nil && cfg.roots != nil && cfg.leaf.Leaf != nil {
		close(cfg.readyCh)
		cfg.readyCh = nil
	}
}
278571
func (s *syncServer) notify(sn *SyncNote) {
	s.sessionLock.RLock()
	sessions := s.sessions
	s.sessionLock.RUnlock()
	for _, ss := range sessions {
		ss.addNote(sn)
	}
}
148065
func (s *Server) notify(h uint16, data []byte) (int, error) {
	// Acquire and reuse notifyBuffer. Release it after usage.
	nBuf := <-s.chNotBuf
	defer func() { s.chNotBuf <- nBuf }()

	rsp := HandleValueNotification(nBuf)
	rsp.SetAttributeOpcode()
	rsp.SetAttributeHandle(h)
	buf := bytes.NewBuffer(rsp.AttributeValue())
	buf.Reset()
	if len(data) > buf.Cap() {
		data = data[:buf.Cap()]
	}
	buf.Write(data)
	return s.conn.Write(rsp[:3+buf.Len()])
}
1188114
func (s *Swarm) StopNotify(f inet.Notifiee) {
	s.notifs.Lock()
	delete(s.notifs.m, f)
	s.notifs.Unlock()
}