def _close_cursor(connection): try: connection.send_message( message.kill_cursors([result['cursor_id']]), callback=None) _handle_finish() except Exception, e: logging.error('Error killing cursor %s: %s' % (result['cursor_id'], e)) connection.close() raise
def _handle_response(self, result, error=None, orig_callback=None): if result and result.get('cursor_id'): connection = self.__pool.connection() try: connection.send_message( message.kill_cursors([result['cursor_id']]), callback=None) except Exception, e: logging.error('Error killing cursor %s: %s' % (result['cursor_id'], e)) connection.close() raise
def _handle_conn(connection): self.__killed = True logging.debug('killing cursor %s', self.__id) try: connection.send_message( message.kill_cursors([self.__id]), callback=None) except Exception, e: logging.error('Error killing cursor %s: %s' % (self.__id, e)) connection.close() raise
def kill_cursors(self, cursor_ids): """Send a kill cursors message with the given ids. Raises :class:`TypeError` if `cursor_ids` is not an instance of ``list``. :Parameters: - `cursor_ids`: list of cursor ids to kill """ if not isinstance(cursor_ids, types.ListType): raise TypeError("cursor_ids must be a list") return self._send_message(message.kill_cursors(cursor_ids))