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

Class _ConnectionManager

pymongo/synchronous/cursor_base.py:33–48  ·  view source on GitHub ↗

Used with exhaust cursors to ensure the connection is returned.

Source from the content-addressed store, hash-verified

31
32
33class _ConnectionManager:
34 """Used with exhaust cursors to ensure the connection is returned."""
35
36 def __init__(self, conn: Connection, more_to_come: bool):
37 self.conn: Optional[Connection] = conn
38 self.more_to_come = more_to_come
39 self._lock = _create_lock()
40
41 def update_exhaust(self, more_to_come: bool) -> None:
42 self.more_to_come = more_to_come
43
44 def close(self) -> None:
45 """Return this instance's connection to the connection pool."""
46 if self.conn:
47 self.conn.unpin()
48 self.conn = None
49
50
51class _CursorBase(_AgnosticCursorBase[_DocumentType]):

Callers 4

_send_messageMethod · 0.90
_maybe_pin_connectionMethod · 0.90
_send_messageMethod · 0.90
pinMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected