From fab252154efa23adceecef1f0403c69f0d937813 Mon Sep 17 00:00:00 2001 From: Adam Holmberg Date: Fri, 8 May 2015 10:04:58 -0500 Subject: [PATCH] Explanation of eventletreactor service_timeouts routine --- cassandra/io/eventletreactor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cassandra/io/eventletreactor.py b/cassandra/io/eventletreactor.py index 5db0816c..aceac55e 100644 --- a/cassandra/io/eventletreactor.py +++ b/cassandra/io/eventletreactor.py @@ -16,7 +16,6 @@ # Originally derived from MagnetoDB source: # https://github.com/stackforge/magnetodb/blob/2015.1.0b1/magnetodb/common/cassandra/io/eventletreactor.py -from collections import defaultdict from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, EINVAL import eventlet from eventlet.green import select, socket @@ -73,6 +72,12 @@ class EventletConnection(Connection): @classmethod def service_timeouts(cls): + """ + cls._timeout_watcher runs in this loop forever. + It is usually waiting for the next timeout on the cls._new_timer Event. + When new timers are added, that event is set so that the watcher can + wake up and possibly set an earlier timeout. + """ timer_manager = cls._timers while True: next_end = timer_manager.service_timeouts()