github.com/unionj-cloud/go-doudou/v2@v2.3.5/toolkit/memberlist/alive_delegate.go (about)

     1  package memberlist
     2  
     3  // AliveDelegate is used to involve a client in processing
     4  // a node "alive" message. When a node joins, either through
     5  // a UDP gossip or TCP push/pull, we update the state of
     6  // that node via an alive message. This can be used to filter
     7  // a node out and prevent it from being considered a peer
     8  // using application specific logic.
     9  type AliveDelegate interface {
    10  	// NotifyAlive is invoked when a message about a live
    11  	// node is received from the network.  Returning a non-nil
    12  	// error prevents the node from being considered a peer.
    13  	NotifyAlive(peer *Node) error
    14  }