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

Method __init__

pymongo/asynchronous/monitor.py:379–396  ·  view source on GitHub ↗

Class to poll SRV records on a background thread. Pass a Topology and a TopologySettings. The Topology is weakly referenced.

(self, topology: Topology, topology_settings: TopologySettings)

Source from the content-addressed store, hash-verified

377
378class SrvMonitor(MonitorBase):
379 def __init__(self, topology: Topology, topology_settings: TopologySettings):
380 """Class to poll SRV records on a background thread.
381
382 Pass a Topology and a TopologySettings.
383
384 The Topology is weakly referenced.
385 """
386 super().__init__(
387 topology,
388 "pymongo_srv_polling_thread",
389 common.MIN_SRV_RESCAN_INTERVAL,
390 topology_settings.heartbeat_frequency,
391 )
392 self._settings = topology_settings
393 self._seedlist = self._settings._seeds
394 assert isinstance(self._settings.fqdn, str)
395 self._fqdn: str = self._settings.fqdn
396 self._startup_time = time.monotonic()
397
398 async def _run(self) -> None:
399 # Don't poll right after creation, wait 60 seconds first

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected