We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 072ca6e commit 7f0c3d3Copy full SHA for 7f0c3d3
src/a2a/server/events/event_consumer.py
@@ -50,6 +50,11 @@ async def consume_all(self) -> AsyncGenerator[Event]:
50
if self._exception:
51
raise self._exception
52
try:
53
+ # We use a timeout when waiting for an event from the queue.
54
+ # This is required because it allows the loop to check if
55
+ # `self._exception` has been set by the `agent_task_callback`.
56
+ # Without the timeout, loop might hang indefinitely if no events are
57
+ # enqueued by the agent and the agent simply threw an exception
58
event = await asyncio.wait_for(self.queue.dequeue_event(), timeout=self._timeout)
59
logger.debug(
60
f'Dequeued event of type: {type(event)} in consume_all.'
0 commit comments