diff options
author | Mark Roberts <wizzat@gmail.com> | 2014-04-25 10:55:04 -0700 |
---|---|---|
committer | Mark Roberts <wizzat@gmail.com> | 2014-04-25 10:55:04 -0700 |
commit | 57913f9f914a959f52bc9040a172f8c9ff77e491 (patch) | |
tree | fe5cc6c14283a4c9d9175a748ef97f7d55df6fd7 /kafka/consumer.py | |
parent | 0e50f33ec678f6d656d488ce8a4537f95bba003e (diff) | |
download | kafka-python-57913f9f914a959f52bc9040a172f8c9ff77e491.tar.gz |
Various fixes
Bump version number to 0.9.1
Update readme to show supported Kafka/Python versions
Validate arguments in consumer.py, add initial consumer unit test
Make service kill() child processes when startup fails
Add tests for util.py, fix Python 2.6 specific bug.
Diffstat (limited to 'kafka/consumer.py')
-rw-r--r-- | kafka/consumer.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kafka/consumer.py b/kafka/consumer.py index 3f8d8c2..98f18a0 100644 --- a/kafka/consumer.py +++ b/kafka/consumer.py @@ -3,6 +3,7 @@ from __future__ import absolute_import from itertools import izip_longest, repeat import logging import time +import numbers from threading import Lock from multiprocessing import Process, Queue as MPQueue, Event, Value from Queue import Empty, Queue @@ -81,6 +82,8 @@ class Consumer(object): if not partitions: partitions = self.client.topic_partitions[topic] + else: + assert all(isinstance(x, numbers.Integral) for x in partitions) # Variables for handling offset commits self.commit_lock = Lock() |