From d3fa42920a1bbdc93bdd4f40c32c552f556e80c0 Mon Sep 17 00:00:00 2001 From: Alexander Malev Date: Thu, 30 Dec 2021 18:05:28 +0300 Subject: [PATCH] fix MyRebalancer on docs/consumer.rst (#731) * fix MyRebalancer on docs/consumer.rst * Create 731.doc --- CHANGES/731.doc | 1 + docs/consumer.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 CHANGES/731.doc diff --git a/CHANGES/731.doc b/CHANGES/731.doc new file mode 100644 index 00000000..e312e171 --- /dev/null +++ b/CHANGES/731.doc @@ -0,0 +1 @@ +fix MyRebalancer on docs/consumer.rst diff --git a/docs/consumer.rst b/docs/consumer.rst index 6fea40c5..8a2f5016 100644 --- a/docs/consumer.rst +++ b/docs/consumer.rst @@ -353,7 +353,7 @@ etc. See :meth:`aiokafka.AIOKafkaConsumer.subscribe` docs for more details. class MyRebalancer(aiokafka.ConsumerRebalanceListener): async def on_partitions_revoked(self, revoked): - async with self.lock: + async with lock: pass async def on_partitions_assigned(self, assigned): @@ -362,7 +362,7 @@ etc. See :meth:`aiokafka.AIOKafkaConsumer.subscribe` docs for more details. async def main(): consumer.subscribe("topic", listener=MyRebalancer()) while True: - async with self.lock: + async with lock: msgs = await consumer.getmany(timeout_ms=1000) # process messages