diff options
author | Will Daly <will@edx.org> | 2015-01-04 12:23:10 -0500 |
---|---|---|
committer | Will Daly <will.e.daly@gmail.com> | 2015-01-15 18:01:40 -0500 |
commit | 01f378328e5383d05d52428b815f992eb2c536cb (patch) | |
tree | 2d3366ed91b9744efd40d935a460040150c6d4d8 /kafka/queue.py | |
parent | 02c2b469003e2ddcb051dbb4d95977137050c19f (diff) | |
download | kafka-python-01f378328e5383d05d52428b815f992eb2c536cb.tar.gz |
Add Sphinx API docs
Diffstat (limited to 'kafka/queue.py')
-rw-r--r-- | kafka/queue.py | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/kafka/queue.py b/kafka/queue.py index ada495f..26cafad 100644 --- a/kafka/queue.py +++ b/kafka/queue.py @@ -129,13 +129,12 @@ class KafkaQueue(object): Messages are buffered in the producer thread until producer_flush_timeout or producer_flush_buffer is reached. - Params - ====== - client: KafkaClient object - topic: str, the topic name - partitions: list of ints, the partions to consume from - producer_config: dict, see below - consumer_config: dict, see below + Arguments: + client: KafkaClient object + topic: str, the topic name + partitions: list of ints, the partions to consume from + producer_config: dict, see below + consumer_config: dict, see below Consumer Config =============== @@ -184,14 +183,12 @@ class KafkaQueue(object): """ Consume a message from Kafka - Params - ====== - block: boolean, default True - timeout: int, number of seconds to wait when blocking, default None + Arguments: + block: boolean, default True + timeout: int, number of seconds to wait when blocking, default None - Returns - ======= - msg: str, the payload from Kafka + Returns: + msg: str, the payload from Kafka """ return self.in_queue.get(block, timeout).payload @@ -199,11 +196,10 @@ class KafkaQueue(object): """ Send a message to Kafka - Params - ====== - msg: std, the message to send - block: boolean, default True - timeout: int, number of seconds to wait when blocking, default None + Arguments: + msg: std, the message to send + block: boolean, default True + timeout: int, number of seconds to wait when blocking, default None """ self.out_queue.put(msg, block, timeout) |