diff options
| author | Martin Ridgers <[email protected]> | 2021-11-16 14:41:55 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-11-16 14:41:55 +0100 |
| commit | 2f45b5f9389d18c795a83f7c08a2e3999940e4d8 (patch) | |
| tree | 35f771b5d9693ebf880ed68ab3db721321d1c9de /zenserver/compute/apply.h | |
| parent | Changed SpawnServer() over to use zen::CreateProc() (diff) | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-2f45b5f9389d18c795a83f7c08a2e3999940e4d8.tar.xz zen-2f45b5f9389d18c795a83f7c08a2e3999940e4d8.zip | |
Merged main
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 2506e7448..a3e36819d 100644 --- a/zenserver/compute/apply.h +++ b/zenserver/compute/apply.h @@ -22,6 +22,7 @@ namespace zen { class CasStore; class CidStore; +class UpstreamApply; /** * Lambda style compute function service @@ -36,14 +37,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 { @@ -52,6 +54,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; |