diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-15 10:19:16 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-19 09:50:37 +0200 |
commit | a5f048e3b2504959994cc9545a70fde01b70d99a (patch) | |
tree | 42ef3e92abdba766e4c56ed8e0dbfff37de22416 /src/buildtool/execution_api/execution_service/operations_server.hpp | |
parent | 1acde5fa1f37b8e4856f96aba092a38faaac737f (diff) | |
download | justbuild-a5f048e3b2504959994cc9545a70fde01b70d99a.tar.gz |
Make OperationCache a general class, not singleton
As it is used by just execute only, instantiate it inside the
ExecutionServer, which reads and writes to the cache map, and pass
a const ref to OperationsServer, which only queries.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/operations_server.hpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/operations_server.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/execution_service/operations_server.hpp b/src/buildtool/execution_api/execution_service/operations_server.hpp index 44e3b887..faa87602 100644 --- a/src/buildtool/execution_api/execution_service/operations_server.hpp +++ b/src/buildtool/execution_api/execution_service/operations_server.hpp @@ -16,11 +16,17 @@ #define OPERATIONS_SERVER_HPP #include "google/longrunning/operations.grpc.pb.h" +#include "gsl/gsl" +#include "src/buildtool/execution_api/execution_service/operation_cache.hpp" #include "src/buildtool/logging/logger.hpp" class OperarationsServiceImpl final : public ::google::longrunning::Operations::Service { public: + explicit OperarationsServiceImpl( + gsl::not_null<OperationCache const*> const& op_cache) + : op_cache_{*op_cache} {}; + // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // @@ -64,6 +70,7 @@ class OperarationsServiceImpl final ::google::protobuf::Empty* response) -> ::grpc::Status override; private: + OperationCache const& op_cache_; Logger logger_{"execution-service:operations"}; }; |