Skip to content

Commit

Permalink
fix MyRebalancer on docs/consumer.rst (#731)
Browse files Browse the repository at this point in the history
* fix MyRebalancer on docs/consumer.rst

* Create 731.doc
  • Loading branch information
aamalev authored Dec 30, 2021
1 parent 6b15132 commit d3fa429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/731.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix MyRebalancer on docs/consumer.rst
4 changes: 2 additions & 2 deletions docs/consumer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand Down

0 comments on commit d3fa429

Please sign in to comment.