Skip to content

Instantly share code, notes, and snippets.

@DFilyushin
Last active February 26, 2024 03:42
Show Gist options
  • Save DFilyushin/b89d1f7379b8cd70d405c5427fedd299 to your computer and use it in GitHub Desktop.
Save DFilyushin/b89d1f7379b8cd70d405c5427fedd299 to your computer and use it in GitHub Desktop.
async def callback_sessions(msg, topic):
pass
def consumer_factory():
for t in topics:
yield AsyncJafkaConsumer(topic=t, ..., callback=partial(callback_sessions, topic=t))
def run():
for c in consumer_factory():
asyncio.ensure_future(c.consume())
loop = asyncio.get_event_loop()
loop.run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment