mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-13 21:27:52 +02:00
scheduler-kafka: Pass loop arg to default async consumer and producer
- Some forks of aiokafka make this a required arg
This commit is contained in:
@@ -69,6 +69,7 @@ class AsyncKafkaExecutor(AbstractAsyncContextManager):
|
||||
self.retry_policy = retry_policy
|
||||
|
||||
async def __aenter__(self) -> Self:
|
||||
loop = asyncio.get_running_loop()
|
||||
self.subgraphs = {
|
||||
k: v async for k, v in self.graph.aget_subgraphs(recurse=True)
|
||||
}
|
||||
@@ -81,6 +82,7 @@ class AsyncKafkaExecutor(AbstractAsyncContextManager):
|
||||
auto_offset_reset="earliest",
|
||||
group_id="executor",
|
||||
enable_auto_commit=False,
|
||||
loop=loop,
|
||||
**self.kwargs,
|
||||
)
|
||||
)
|
||||
@@ -89,6 +91,7 @@ class AsyncKafkaExecutor(AbstractAsyncContextManager):
|
||||
|
||||
self.producer = await self.stack.enter_async_context(
|
||||
DefaultAsyncProducer(
|
||||
loop=loop,
|
||||
**self.kwargs,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -67,6 +67,7 @@ class AsyncKafkaOrchestrator(AbstractAsyncContextManager):
|
||||
self.retry_policy = retry_policy
|
||||
|
||||
async def __aenter__(self) -> Self:
|
||||
loop = asyncio.get_running_loop()
|
||||
self.subgraphs = {
|
||||
k: v async for k, v in self.graph.aget_subgraphs(recurse=True)
|
||||
}
|
||||
@@ -79,6 +80,7 @@ class AsyncKafkaOrchestrator(AbstractAsyncContextManager):
|
||||
auto_offset_reset="earliest",
|
||||
group_id="orchestrator",
|
||||
enable_auto_commit=False,
|
||||
loop=loop,
|
||||
**self.kwargs,
|
||||
)
|
||||
)
|
||||
@@ -87,6 +89,7 @@ class AsyncKafkaOrchestrator(AbstractAsyncContextManager):
|
||||
|
||||
self.producer = await self.stack.enter_async_context(
|
||||
DefaultAsyncProducer(
|
||||
loop=loop,
|
||||
**self.kwargs,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user