diff options
| author | Joe Kirchoff <[email protected]> | 2021-11-15 15:25:17 -0800 |
|---|---|---|
| committer | Joe Kirchoff <[email protected]> | 2021-11-15 15:25:17 -0800 |
| commit | 20874d3801c4ed142dfd5246a850452f24043512 (patch) | |
| tree | e67ee13eededfd5dd9754704e3b037a6be4b981a /zenserver/compute/apply.h | |
| parent | Horde Apply: Pass through (diff) | |
| download | zen-20874d3801c4ed142dfd5246a850452f24043512.tar.xz zen-20874d3801c4ed142dfd5246a850452f24043512.zip | |
Use upstream apply with Horde
Diffstat (limited to 'zenserver/compute/apply.h')
| -rw-r--r-- | zenserver/compute/apply.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/zenserver/compute/apply.h b/zenserver/compute/apply.h index 86b262213..15cda4750 100644 --- a/zenserver/compute/apply.h +++ b/zenserver/compute/apply.h @@ -14,6 +14,7 @@ namespace zen { class CasStore; class CidStore; +class UpstreamApply; /** * Lambda style compute function service @@ -28,14 +29,15 @@ public: virtual void HandleRequest(HttpServerRequest& Request) override; private: - spdlog::logger& Log() { return m_Log; } - spdlog::logger& m_Log; - HttpRequestRouter m_Router; - CasStore& m_CasStore; - CidStore& m_CidStore; - std::filesystem::path m_SandboxPath; - std::filesystem::path m_FunctionPath; - std::atomic<int> m_SandboxCount{0}; + spdlog::logger& Log() { return m_Log; } + spdlog::logger& m_Log; + HttpRequestRouter m_Router; + CasStore& m_CasStore; + CidStore& m_CidStore; + std::filesystem::path m_SandboxPath; + std::filesystem::path m_FunctionPath; + std::atomic<int> m_SandboxCount{0}; + std::unique_ptr<UpstreamApply> m_UpstreamApply; struct WorkerDesc { @@ -44,6 +46,8 @@ private: [[nodiscard]] std::filesystem::path CreateNewSandbox(); [[nodiscard]] CbPackage ExecAction(const WorkerDesc& Worker, CbObject Action); + [[nodiscard]] CbObject ExecActionUpstream(const WorkerDesc& Worker, CbObject Action); + [[nodiscard]] HttpResponseCode ExecActionUpstreamResult(const IoHash& WorkerId, const IoHash& ActionId, CbPackage& Package); RwLock m_WorkerLock; std::unordered_map<IoHash, WorkerDesc> m_WorkerMap; |