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

Method cancel_check

pymongo/synchronous/monitor.py:169–180  ·  view source on GitHub ↗

Cancel any concurrent hello check. Note: this is called from a weakref.proxy callback and MUST NOT take any locks.

(self)

Source from the content-addressed store, hash-verified

167 self._stream = not _is_faas()
168
169 def cancel_check(self) -> None:
170 """Cancel any concurrent hello check.
171
172 Note: this is called from a weakref.proxy callback and MUST NOT take
173 any locks.
174 """
175 context = self._cancel_context
176 if context:
177 # Note: we cannot close the socket because doing so may cause
178 # concurrent reads/writes to hang until a timeout occurs
179 # (depending on the platform).
180 context.cancel()
181
182 def _start_rtt_monitor(self) -> None:
183 """Start an _RttMonitor that periodically runs ping."""

Callers 2

gc_safe_closeMethod · 0.95
_handle_errorMethod · 0.45

Calls 1

cancelMethod · 0.45

Tested by

no test coverage detected