Skip to content

Commit a2a51bf

Browse files
committed
Formatting
1 parent 81073fe commit a2a51bf

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/a2a/server/events/event_consumer.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ async def consume_all(self) -> AsyncGenerator[Event]:
5151
raise self._exception
5252
try:
5353
# 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`.
54+
# This is required because it allows the loop to check if
55+
# `self._exception` has been set by the `agent_task_callback`.
5656
# Without the timeout, loop might hang indefinitely if no events are
5757
# enqueued by the agent and the agent simply threw an exception
58-
event = await asyncio.wait_for(self.queue.dequeue_event(), timeout=self._timeout)
58+
event = await asyncio.wait_for(
59+
self.queue.dequeue_event(), timeout=self._timeout
60+
)
5961
logger.debug(
6062
f'Dequeued event of type: {type(event)} in consume_all.'
6163
)
@@ -88,11 +90,7 @@ async def consume_all(self) -> AsyncGenerator[Event]:
8890
continue
8991
except asyncio.QueueShutDown:
9092
break
91-
92-
93-
94-
9593

9694
def agent_task_callback(self, agent_task: asyncio.Task[None]):
97-
if agent_task.exception() is not None:
98-
self._exception = agent_task.exception()
95+
if agent_task.exception() is not None:
96+
self._exception = agent_task.exception()

0 commit comments

Comments
 (0)