MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / async_get_pool

Function async_get_pool

test/asynchronous/utils.py:42–46  ·  view source on GitHub ↗

Get the standalone, primary, or mongos pool.

(client: AsyncMongoClient)

Source from the content-addressed store, hash-verified

40
41
42async def async_get_pool(client: AsyncMongoClient) -> Pool:
43 """Get the standalone, primary, or mongos pool."""
44 topology = await client._get_topology()
45 server = await topology._select_server(writable_server_selector, _Op.TEST)
46 return server.pool
47
48
49async def async_get_pools(client: AsyncMongoClient) -> list[Pool]:

Calls 2

_get_topologyMethod · 0.45
_select_serverMethod · 0.45