summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDavid Arthur <mumrah@gmail.com>2013-07-26 08:39:44 -0400
committerDavid Arthur <mumrah@gmail.com>2013-07-26 08:39:44 -0400
commite297a7a8c8f9de341b0e91346236455d12ae7f82 (patch)
treef4db35ab88fa39684d4ab680428adf815000eaa5 /README.md
parent5684af438e6cf871540aa8ea8b556737f56e9798 (diff)
parent1d278f0f60cb0a7b76fbc6b80c8e112a0deb2e0c (diff)
downloadkafka-python-e297a7a8c8f9de341b0e91346236455d12ae7f82.tar.gz
Merge branch 'issue-35'
Conflicts: kafka/__init__.py kafka/consumer.py test/test_integration.py
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.md b/README.md
index 829fab2..19e9a42 100644
--- a/README.md
+++ b/README.md
@@ -89,6 +89,24 @@ producer.send("key2", "this methode")
producer = KeyedProducer(kafka, "my-topic", partitioner=RoundRobinPartitioner)
```
+## Multiprocess consumer
+```python
+from kafka.consume import MultiProcessConsumer
+
+# This will split the number of partitions among two processes
+consumer = MultiProcessConsumer(kafka, "my-topic", "my-group", num_procs=2)
+
+# This will spawn processes such that each handles 2 partitions max
+consumer = MultiProcessConsumer(kafka, "my-topic", "my-group",
+ partitions_per_proc=2)
+
+for message in consumer:
+ print(message)
+
+for message in consumer.get_messages(count=5, block=True, timeout=4):
+ print(message)
+```
+
## Low level
```python