(self)
| 97 | return node |
| 98 | |
| 99 | def run(self): |
| 100 | while self.timers: |
| 101 | next_timer = self.timers[0] |
| 102 | if next_timer.expires > self.now: |
| 103 | self.now = next_timer.expires |
| 104 | heapq.heappop(self.timers) |
| 105 | if next_timer.cancelled: |
| 106 | continue |
| 107 | if not next_timer.address or next_timer.address in self.nodes: |
| 108 | next_timer.callback() |
| 109 | |
| 110 | def stop(self): |
| 111 | self.timers = [] |
no outgoing calls