Skip to content

Commit

Permalink
Manually connect broker in Factory.create_standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed Aug 14, 2024
1 parent 56d2a75 commit 3d23213
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ook/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ async def create_standalone(
"""
factory = await cls.create(logger=logger, kafka_broker=kafka_broker)
async with aclosing(factory):
# Manually connect the broker after the publishers are created
# so that the producer can be added to each publisher.
await factory._process_context.kafka_broker.connect() # noqa: SLF001
yield factory

async def aclose(self) -> None:
Expand Down

0 comments on commit 3d23213

Please sign in to comment.