Exemple #1
0
    def fire(self):
        """Fire the timer."""
        assert self.isReady()
        self._next = simtime.now() + self._cur_delay
        self._cur_delay *= self._multiplier

        self.fireAction()
Exemple #2
0
    def fire(self):
        """Fire the timer."""
        assert self.isReady()
        self._next = simtime.now() + self._cur_delay
        self._cur_delay *= self._multiplier

        self.fireAction()
Exemple #3
0
    def __init__(self, node):
        # tornet.Node instance
        self._node = node

        # True iff we have marked this node as down.
        self._markedDown = False

        # True iff we have marked this node as up.
        self._markedUp = False

        # True iff we've attempted to connect to this node.
        self._tried = False

        # When did we add it (simulated)?
        self._addedAt = simtime.now()

        # True iff the node is listed as a guard in the most recent consensus
        self._listed = True
Exemple #4
0
    def __init__(self, node):
        # tornet.Node instance
        self._node = node

        # True iff we have marked this node as down.
        self._markedDown = False

        # True iff we have marked this node as up.
        self._markedUp = False

        # True iff we've attempted to connect to this node.
        self._tried = False

        # When did we add it (simulated)?
        self._addedAt = simtime.now()

        # True iff the node is listed as a guard in the most recent consensus
        self._listed = True
Exemple #5
0
 def isReady(self):
     """Return true iff the timer is ready to fire now."""
     if self._paused:
         return False
     return self._next <= simtime.now()
Exemple #6
0
 def addedWithin(self, nSec):
     """Return ``True`` iff this guard was added within the last **nSec**
     simulated seconds.
     """
     return self._addedAt + nSec >= simtime.now()
Exemple #7
0
 def isReady(self):
     """Return true iff the timer is ready to fire now."""
     if self._paused:
         return False
     return self._next <= simtime.now()
Exemple #8
0
 def addedWithin(self, nSec):
     """Return ``True`` iff this guard was added within the last **nSec**
     simulated seconds.
     """
     return self._addedAt + nSec >= simtime.now()
Exemple #9
0
 def isReady(self):
     """Return true iff the timer is ready to fire now."""
     return self._next <= simtime.now()
Exemple #10
0
 def addedWithin(self, nSec):
     """Return true iff this guard was added within the last 'nSec'
        simulated seconds."""
     return self._addedAt + nSec >= simtime.now()