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

Method __init__

pymongo/synchronous/monitor.py:377–394  ·  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

375
376class SrvMonitor(MonitorBase):
377 def __init__(self, topology: Topology, topology_settings: TopologySettings):
378 """Class to poll SRV records on a background thread.
379
380 Pass a Topology and a TopologySettings.
381
382 The Topology is weakly referenced.
383 """
384 super().__init__(
385 topology,
386 "pymongo_srv_polling_thread",
387 common.MIN_SRV_RESCAN_INTERVAL,
388 topology_settings.heartbeat_frequency,
389 )
390 self._settings = topology_settings
391 self._seedlist = self._settings._seeds
392 assert isinstance(self._settings.fqdn, str)
393 self._fqdn: str = self._settings.fqdn
394 self._startup_time = time.monotonic()
395
396 def _run(self) -> None:
397 # 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