Skip to content

Commit e0c5cab

Browse files
committed
Add an ability to pass custom event loop to QuerySessionPool
1 parent ce4e31d commit e0c5cab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ydb/aio/query/pool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(
2929
size: int = 100,
3030
*,
3131
query_client_settings: Optional[QueryClientSettings] = None,
32+
loop: Optional[asyncio.AbstractEventLoop] = None,
3233
):
3334
"""
3435
:param driver: A driver instance
@@ -42,7 +43,7 @@ def __init__(
4243
self._queue = asyncio.Queue()
4344
self._current_size = 0
4445
self._waiters = 0
45-
self._loop = asyncio.get_running_loop()
46+
self._loop = asyncio.get_running_loop() if loop is None else loop
4647
self._query_client_settings = query_client_settings
4748

4849
async def _create_new_session(self):

0 commit comments

Comments
 (0)