Skip to content

Commit ecc9f18

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: remove unecessary event loop creation in LiveRequstQueue constructor
Before Python 3.10, asyncio.Queue() required a running event loop at creation time. This was deprecated in 3.8-3.9 and fully removed in 3.10. ADK requires Python 3.10+, thus remove this unecessary logic Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 852989791
1 parent 6dce7f8 commit ecc9f18

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

src/google/adk/agents/live_request_queue.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ class LiveRequestQueue:
4545
"""Queue used to send LiveRequest in a live(bidirectional streaming) way."""
4646

4747
def __init__(self):
48-
# Ensure there's an event loop available in this thread
49-
try:
50-
asyncio.get_running_loop()
51-
except RuntimeError:
52-
# No running loop, create one
53-
loop = asyncio.new_event_loop()
54-
asyncio.set_event_loop(loop)
55-
56-
# Now create the queue (it will use the event loop we just ensured exists)
5748
self._queue = asyncio.Queue()
5849

5950
def close(self):

0 commit comments

Comments
 (0)