summaryrefslogtreecommitdiff
path: root/src/mongo/s/async_requests_sender.h
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2022-03-11 15:59:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-11 17:29:38 +0000
commitb2cfe4aed88f2a1232f952196140d06509677be7 (patch)
treea5109b87e351f557e4f78f905592d0cfd6fb3ce1 /src/mongo/s/async_requests_sender.h
parent5cb71ebbfc5db3f1457fdb2512e74c753870af6f (diff)
downloadmongo-b2cfe4aed88f2a1232f952196140d06509677be7.tar.gz
SERVER-64407 Add ResourceYielder support to ARS
Diffstat (limited to 'src/mongo/s/async_requests_sender.h')
-rw-r--r--src/mongo/s/async_requests_sender.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/s/async_requests_sender.h b/src/mongo/s/async_requests_sender.h
index 3e14bec56d3..432227356cc 100644
--- a/src/mongo/s/async_requests_sender.h
+++ b/src/mongo/s/async_requests_sender.h
@@ -36,6 +36,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/client/read_preference.h"
#include "mongo/db/baton.h"
+#include "mongo/db/resource_yielder.h"
#include "mongo/executor/remote_command_response.h"
#include "mongo/executor/scoped_task_executor.h"
#include "mongo/executor/task_executor.h"
@@ -135,7 +136,8 @@ public:
StringData dbName,
const std::vector<AsyncRequestsSender::Request>& requests,
const ReadPreferenceSetting& readPreference,
- Shard::RetryPolicy retryPolicy);
+ Shard::RetryPolicy retryPolicy,
+ std::unique_ptr<ResourceYielder> resourceYielder);
/**
* Returns true if responses for all requests have been returned via next().
@@ -294,6 +296,10 @@ private:
// Scoped baton holder which ensures any callbacks which touch this ARS are called with a
// not-okay status (or not run, in the case of ExecutorFuture continuations).
Baton::SubBatonHolder _subBaton;
+
+ // Interface for yielding and unyielding resources while waiting on results from the network.
+ // Null if yielding isn't necessary.
+ std::unique_ptr<ResourceYielder> _resourceYielder;
};
} // namespace mongo