From 1622c6b7a7971ea7fbdd4b3d5b10455e48e5cf69 Mon Sep 17 00:00:00 2001 From: Jonathan Reams Date: Tue, 27 Jun 2017 14:04:53 -0400 Subject: SERVER-29402 Implement ServiceExecutor and fixed-size test executor --- src/mongo/db/service_context.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mongo/db/service_context.h') diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h index 2386e3065a7..db486a72857 100644 --- a/src/mongo/db/service_context.h +++ b/src/mongo/db/service_context.h @@ -40,6 +40,7 @@ #include "mongo/stdx/functional.h" #include "mongo/stdx/memory.h" #include "mongo/stdx/mutex.h" +#include "mongo/transport/service_executor_base.h" #include "mongo/transport/session.h" #include "mongo/util/clock_source.h" #include "mongo/util/decorable.h" @@ -370,6 +371,14 @@ public: */ ServiceEntryPoint* getServiceEntryPoint() const; + /** + * Get the service executor for the service context. + * + * See ServiceStateMachine for how this is used. Some configurations may not have a service + * executor registered and this will return a nullptr. + */ + transport::ServiceExecutor* getServiceExecutor() const; + /** * Waits for the ServiceContext to be fully initialized and for all TransportLayers to have been * added/started. @@ -444,6 +453,11 @@ public: */ void setTransportLayer(std::unique_ptr tl); + /** + * Binds the service executor to the service context + */ + void setServiceExecutor(std::unique_ptr exec); + protected: ServiceContext(); @@ -486,6 +500,11 @@ private: */ std::unique_ptr _serviceEntryPoint; + /** + * The ServiceExecutor + */ + std::unique_ptr _serviceExecutor; + /** * Vector of registered observers. */ -- cgit v1.2.1