diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2023-02-27 10:27:52 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-03-10 09:38:39 +0100 |
commit | 55ba09ec97d2449b39d7fcc38c346969168d899b (patch) | |
tree | 4c97affeaae2e5bb88a41be6d389b2502bae6e24 /src/buildtool/execution_api/execution_service/execution_server.hpp | |
parent | 117a1dbf099d93dfe044971f90203a5d8d1975b4 (diff) | |
download | justbuild-55ba09ec97d2449b39d7fcc38c346969168d899b.tar.gz |
execution service: implement WaitExecution and google::longrunning::Operations::GetOperation
For each action that is executed, an entry is added to a shared thread
safe cache. Once the number of operations stored exceeds twice 2^n,
where n is given by the option --log-operations-threshold, at most 2^n
operations will be removed, in a FIFO scheme.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/execution_server.hpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/execution_server.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/buildtool/execution_api/execution_service/execution_server.hpp b/src/buildtool/execution_api/execution_service/execution_server.hpp index d0ec5074..65ace208 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.hpp +++ b/src/buildtool/execution_api/execution_service/execution_server.hpp @@ -107,6 +107,10 @@ class ExecutionServiceImpl final : public bazel_re::Execution::Service { -> ::grpc::Status override; private: + LocalStorage storage_{}; + IExecutionApi::Ptr api_{new LocalApi()}; + Logger logger_{"execution-service"}; + [[nodiscard]] auto GetAction(::bazel_re::ExecuteRequest const* request) const noexcept -> std::pair<std::optional<::bazel_re::Action>, std::optional<std::string>>; @@ -126,21 +130,17 @@ class ExecutionServiceImpl final : public bazel_re::Execution::Service { -> std::pair<std::optional<::bazel_re::ExecuteResponse>, std::optional<std::string>>; - [[nodiscard]] auto WriteResponse( + [[nodiscard]] auto StoreActionResult( ::bazel_re::ExecuteRequest const* request, IExecutionResponse::Ptr const& i_execution_response, - ::bazel_re::Action const& action, - ::grpc::ServerWriter<::google::longrunning::Operation>* writer) - const noexcept -> std::optional<std::string>; + ::bazel_re::ExecuteResponse const& execute_response, + ::bazel_re::Action const& action) const noexcept + -> std::optional<std::string>; [[nodiscard]] auto AddResult( ::bazel_re::ExecuteResponse* response, IExecutionResponse::Ptr const& i_execution_response, std::string const& hash) const noexcept -> std::optional<std::string>; - - LocalStorage storage_{}; - IExecutionApi::Ptr api_{new LocalApi()}; - Logger logger_{"execution-service"}; }; #endif |