Skip to content

Commit cb47ecc

Browse files
authored
Merge pull request #515 from ydb-platform/custom_loop_for_session_pool
Add an ability to pass custom event loop to QuerySessionPool
2 parents ce4e31d + e0c5cab commit cb47ecc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ydb/aio/query/pool.py

+2-1
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)