Closes this cursor.
(self)
| 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.""" |
no test coverage detected