summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@mongodb.com>2021-02-16 16:51:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-26 00:47:47 +0000
commit73c56d73d1e826626bb62590e423bef0e8956bdb (patch)
tree1e2b6bbc6d10d518f8e43377e5ab1cc003e2d7ae /src/mongo/db/commands.h
parentb65805e2ccaea3a7f4e09b52abe85128df4db676 (diff)
downloadmongo-73c56d73d1e826626bb62590e423bef0e8956bdb.tar.gz
SERVER-54539 Make command execution mindful of the threading model
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r--src/mongo/db/commands.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 813c5397ab2..dc1519c167b 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -54,6 +54,7 @@
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/rpc/op_msg.h"
#include "mongo/rpc/reply_builder_interface.h"
+#include "mongo/transport/service_executor.h"
#include "mongo/util/fail_point.h"
#include "mongo/util/future.h"
#include "mongo/util/string_map.h"
@@ -256,6 +257,15 @@ struct CommandHelpers {
static BSONObj runCommandDirectly(OperationContext* opCtx, const OpMsgRequest& request);
/**
+ * Decides the command execution model (i.e., synchronous or asynchronous) based on the provided
+ * threading model.
+ */
+ static Future<void> runCommandInvocation(
+ std::shared_ptr<RequestExecutionContext> rec,
+ std::shared_ptr<CommandInvocation> invocation,
+ transport::ServiceExecutor::ThreadingModel threadingModel);
+
+ /**
* Runs a previously parsed CommandInvocation and propagates the result to the
* ReplyBuilderInterface. This function is agnostic to the derived type of the CommandInvocation
* but may mirror, forward, or do other supplementary actions with the request.