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

Method _die_lock

pymongo/asynchronous/cursor_base.py:68–86  ·  view source on GitHub ↗

Closes this cursor.

(self)

Source from the content-addressed store, hash-verified

66 ...
67
68 async def _die_lock(self) -> None:
69 """Closes this cursor."""
70 try:
71 already_killed = self._killed
72 except AttributeError:
73 # ___init__ did not run to completion (or at all).
74 return
75
76 cursor_id, address = self._prepare_to_die(already_killed)
77 await self._collection.database.client._cleanup_cursor_lock(
78 cursor_id,
79 address,
80 self._sock_mgr,
81 self._session,
82 )
83 if self._session and self._session._implicit:
84 self._session._attached_to_cursor = False
85 self._session = None
86 self._sock_mgr = None
87
88 async def close(self) -> None:
89 """Explicitly close / kill this cursor."""

Callers 2

closeMethod · 0.95
_refreshMethod · 0.45

Calls 2

_prepare_to_dieMethod · 0.80
_cleanup_cursor_lockMethod · 0.45

Tested by

no test coverage detected