aboutsummaryrefslogtreecommitdiff
path: root/zenserver/compute/apply.h
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-11-16 14:41:55 +0100
committerMartin Ridgers <[email protected]>2021-11-16 14:41:55 +0100
commit2f45b5f9389d18c795a83f7c08a2e3999940e4d8 (patch)
tree35f771b5d9693ebf880ed68ab3db721321d1c9de /zenserver/compute/apply.h
parentChanged SpawnServer() over to use zen::CreateProc() (diff)
parentMerge branch 'main' of https://github.com/EpicGames/zen (diff)
downloadzen-2f45b5f9389d18c795a83f7c08a2e3999940e4d8.tar.xz
zen-2f45b5f9389d18c795a83f7c08a2e3999940e4d8.zip
Merged main
Diffstat (limited to 'zenserver/compute/apply.h')
-rw-r--r--zenserver/compute/apply.h20
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;