diff options
author | Mahendra M <mahendra.m@gmail.com> | 2013-06-12 13:42:24 +0530 |
---|---|---|
committer | Mahendra M <mahendra.m@gmail.com> | 2013-06-12 13:42:24 +0530 |
commit | b0c87eed088936c9ec571f789d7818bf445d47b3 (patch) | |
tree | 19fc42b1aa94305c8fb257c8fb694d4778dec03f /kafka/queue.py | |
parent | a4601d3a1bf6792e0d57e600f48e891ef2be1528 (diff) | |
download | kafka-python-b0c87eed088936c9ec571f789d7818bf445d47b3.tar.gz |
Optimize auto-commit thread
The previous commit optimized the commit thread such that the timer
started only when there were messages to be consumed. This commit
goes a step further and ensures the following:
* Only one timer thread is created
* The main app does not block on exit (waiting for timer thread to finish)
This is ensured by having a single thread blocking on an event and
keeps calling a function. We use events instead of time.sleep() so
as to prevent the python interpreter from running every 50ms checking
if the timer has expired (logic copied from threading.Timer)
Diffstat (limited to 'kafka/queue.py')
0 files changed, 0 insertions, 0 deletions