Example #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()
Example #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()
Example #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
Example #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
Example #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()
Example #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()
Example #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()
Example #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()
Example #9
0
 def isReady(self):
     """Return true iff the timer is ready to fire now."""
     return self._next <= simtime.now()
Example #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()