MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / service_timeouts

Method service_timeouts

cassandra/connection.py:1812–1834  ·  view source on GitHub ↗

run callbacks on all expired timers Called from the event thread :return: next end time, or None

(self)

Source from the content-addressed store, hash-verified

1810 self._new_timers.append((timer.end, timer))
1811
1812 def service_timeouts(self):
1813 """
1814 run callbacks on all expired timers
1815 Called from the event thread
1816 :return: next end time, or None
1817 """
1818 queue = self._queue
1819 if self._new_timers:
1820 new_timers = self._new_timers
1821 while new_timers:
1822 heappush(queue, new_timers.pop())
1823
1824 if queue:
1825 now = time.time()
1826 while queue:
1827 try:
1828 timer = queue[0][1]
1829 if timer.finish(now):
1830 heappop(queue)
1831 else:
1832 return timer.end
1833 except Exception:
1834 log.exception("Exception while servicing timeout callback: ")
1835
1836 @property
1837 def next_timeout(self):

Callers 1

test_timer_collisionMethod · 0.95

Calls 3

popMethod · 0.45
timeMethod · 0.45
finishMethod · 0.45

Tested by 1

test_timer_collisionMethod · 0.76