txgossip/recipies.py
def value_changed(self, peer, key, value):
        """Inform about a change of a key-value pair.

        @param peer: The peer that changed a value.
        @param key: The key.
        @param value: The new value.

        @return: C{True} if this method acted on the change, or if it
           was unrelated.
        """
        if key == self.VOTE_KEY:
            leader = self._check_consensus(self.VOTE_KEY)
            if leader:
                self._gossiper.set(self.LEADER_KEY, leader)
        elif key == self.LEADER_KEY:
            leader = self._check_consensus(self.LEADER_KEY)
            if leader:
                self.leader_elected(
                    self._gossiper.name == leader, leader)
        elif key == self.PRIO_KEY:
            self.start_election()

        return key in (self.VOTE_KEY, self.LEADER_KEY, self.PRIO_KEY)
Inform about a change of a key-value pair.

        @param peer: The peer that changed a value.
        @param key: The key.
        @param value: The new value.

        @return: C{True} if this method acted on the change, or if it
           was unrelated.
        
Inform about a change of a key-value pair.
Inform about a change of a key - value pair .
def value_changed(self, peer, key, value):
        if key == self.VOTE_KEY:
            leader = self._check_consensus(self.VOTE_KEY)
            if leader:
                self._gossiper.set(self.LEADER_KEY, leader)
        elif key == self.LEADER_KEY:
            leader = self._check_consensus(self.LEADER_KEY)
            if leader:
                self.leader_elected(
                    self._gossiper.name == leader, leader)
        elif key == self.PRIO_KEY:
            self.start_election()
        return key in (self.VOTE_KEY, self.LEADER_KEY, self.PRIO_KEY)
def value_changed ( self , peer , key , value ) : if key == self . VOTE_KEY : leader = self . _check_consensus ( self . VOTE_KEY ) if leader : self . _gossiper . set ( self . LEADER_KEY , leader ) elif key == self . LEADER_KEY : leader = self . _check_consensus ( self . LEADER_KEY ) if leader : self . leader_elected ( self . _gossiper . name == leader , leader ) elif key == self . PRIO_KEY : self . start_election ( ) return key in ( self . VOTE_KEY , self . LEADER_KEY , self . PRIO_KEY )
Inform about a change of a key-value pair.
Inform about a change of a key - value pair .
"""Inform about a change of a key-value pair.

        @param peer: The peer that changed a value.
        @param key: The key.
        @param value: The new value.

        @return: C{True} if this method acted on the change, or if it
           was unrelated.
        """
C{True} if this method acted on the change, or if it
was unrelated.
C { True } if this method acted on the change or if it was unrelated .
self
peer
The peer that changed a value.
The peer that changed a value .
key
None
value
The new value.
The new value .