MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / __init__

Method __init__

pymongo/pool_options.py:298–366  ·  view source on GitHub ↗
(
        self,
        max_pool_size: int = MAX_POOL_SIZE,
        min_pool_size: int = MIN_POOL_SIZE,
        max_idle_time_seconds: Optional[int] = MAX_IDLE_TIME_SEC,
        connect_timeout: Optional[float] = None,
        socket_timeout: Optional[float] = None,
        wait_queue_timeout: Optional[int] = WAIT_QUEUE_TIMEOUT,
        ssl_context: Optional[SSLContext] = None,
        tls_allow_invalid_hostnames: bool = False,
        event_listeners: Optional[_EventListeners] = None,
        appname: Optional[str] = None,
        driver: Optional[DriverInfo] = None,
        compression_settings: Optional[CompressionSettings] = None,
        max_connecting: int = MAX_CONNECTING,
        pause_enabled: bool = True,
        server_api: Optional[ServerApi] = None,
        load_balanced: Optional[bool] = None,
        credentials: Optional[MongoCredential] = None,
        is_sync: Optional[bool] = True,
    )

Source from the content-addressed store, hash-verified

296 )
297
298 def __init__(
299 self,
300 max_pool_size: int = MAX_POOL_SIZE,
301 min_pool_size: int = MIN_POOL_SIZE,
302 max_idle_time_seconds: Optional[int] = MAX_IDLE_TIME_SEC,
303 connect_timeout: Optional[float] = None,
304 socket_timeout: Optional[float] = None,
305 wait_queue_timeout: Optional[int] = WAIT_QUEUE_TIMEOUT,
306 ssl_context: Optional[SSLContext] = None,
307 tls_allow_invalid_hostnames: bool = False,
308 event_listeners: Optional[_EventListeners] = None,
309 appname: Optional[str] = None,
310 driver: Optional[DriverInfo] = None,
311 compression_settings: Optional[CompressionSettings] = None,
312 max_connecting: int = MAX_CONNECTING,
313 pause_enabled: bool = True,
314 server_api: Optional[ServerApi] = None,
315 load_balanced: Optional[bool] = None,
316 credentials: Optional[MongoCredential] = None,
317 is_sync: Optional[bool] = True,
318 ):
319 self.__max_pool_size = max_pool_size
320 self.__min_pool_size = min_pool_size
321 self.__max_idle_time_seconds = max_idle_time_seconds
322 self.__connect_timeout = connect_timeout
323 self.__socket_timeout = socket_timeout
324 self.__wait_queue_timeout = wait_queue_timeout
325 self.__ssl_context = ssl_context
326 self.__tls_allow_invalid_hostnames = tls_allow_invalid_hostnames
327 self.__event_listeners = event_listeners
328 self.__appname = appname
329 self.__driver = driver
330 self.__compression_settings = compression_settings
331 self.__max_connecting = max_connecting
332 self.__pause_enabled = pause_enabled
333 self.__server_api = server_api
334 self.__load_balanced = load_balanced
335 self.__credentials = credentials
336 self.__metadata = copy.deepcopy(_METADATA)
337
338 if appname:
339 self.__metadata["application"] = {"name": appname}
340
341 # Combine the "driver" AsyncMongoClient option with PyMongo's info, like:
342 # {
343 # 'driver': {
344 # 'name': 'PyMongo|MyDriver',
345 # 'version': '4.2.0|1.2.3',
346 # },
347 # 'platform': 'CPython 3.8.0|MyPlatform'
348 # }
349 if has_c():
350 self.__metadata["driver"]["name"] = "{}|{}".format(
351 self.__metadata["driver"]["name"],
352 "c",
353 )
354 if not is_sync:
355 self.__metadata["driver"]["name"] = "{}|{}".format(

Callers

nothing calls this directly

Calls 4

_update_metadataMethod · 0.95
has_cFunction · 0.90
_metadata_envFunction · 0.85
_truncate_metadataFunction · 0.85

Tested by

no test coverage detected