summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclientcursor.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-07-23 13:51:16 -0400
committerMathias Stearn <mathias@10gen.com>2015-07-24 17:20:39 -0400
commit0476dec3ae310f768ae7fd31418a4c8aa7c24506 (patch)
tree970c66ed5494e1b76e8126366dc8e7f81d35fb09 /src/mongo/client/dbclientcursor.h
parent7cdd8036184934ef5ef42907f890b6603cd891a7 (diff)
downloadmongo-0476dec3ae310f768ae7fd31418a4c8aa7c24506.tar.gz
SERVER-19464 Add a way to explicitly kill a DBClientCursor before destruction
Diffstat (limited to 'src/mongo/client/dbclientcursor.h')
-rw-r--r--src/mongo/client/dbclientcursor.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/client/dbclientcursor.h b/src/mongo/client/dbclientcursor.h
index c10f4adf8ff..2dede943b4b 100644
--- a/src/mongo/client/dbclientcursor.h
+++ b/src/mongo/client/dbclientcursor.h
@@ -229,6 +229,18 @@ public:
*/
void exhaustReceiveMore();
+ /**
+ * Marks this object as dead and sends the KillCursors message to the server.
+ *
+ * Any errors that result from this are swallowed since this is typically performed as part of
+ * cleanup and a failure to kill the cursor should not result in a failure of the operation
+ * using the cursor.
+ *
+ * Killing an already killed or exhausted cursor does nothing, so it is safe to always call this
+ * if you want to ensure that a cursor is killed.
+ */
+ void kill();
+
private:
DBClientCursor(DBClientBase* client,
const std::string& ns,