diff options
Diffstat (limited to 'src/zenserver/compute/function.h')
| -rw-r--r-- | src/zenserver/compute/function.h | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/zenserver/compute/function.h b/src/zenserver/compute/function.h deleted file mode 100644 index 650cee757..000000000 --- a/src/zenserver/compute/function.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include <zencore/zencore.h> - -#if !defined(ZEN_WITH_COMPUTE_SERVICES) -# define ZEN_WITH_COMPUTE_SERVICES 1 -#endif - -#if ZEN_WITH_COMPUTE_SERVICES - -# include <zencore/compactbinary.h> -# include <zencore/iohash.h> -# include <zencore/logging.h> -# include <zenhttp/httpserver.h> - -# include <filesystem> -# include <unordered_map> - -namespace zen { - -class CidStore; -class UpstreamApply; -class CloudCacheClient; -class AuthMgr; - -struct UpstreamAuthConfig; -struct CloudCacheClientOptions; - -/** - * Lambda style compute function service - */ -class HttpFunctionService : public HttpService -{ -public: - HttpFunctionService(CidStore& InCidStore, - const CloudCacheClientOptions& ComputeOptions, - const CloudCacheClientOptions& StorageOptions, - const UpstreamAuthConfig& ComputeAuthConfig, - const UpstreamAuthConfig& StorageAuthConfig, - AuthMgr& Mgr); - ~HttpFunctionService(); - - virtual const char* BaseUri() const override; - virtual void HandleRequest(HttpServerRequest& Request) override; - -private: - std::thread InitializeThread; - spdlog::logger& Log() { return m_Log; } - spdlog::logger& m_Log; - HttpRequestRouter m_Router; - CidStore& m_CidStore; - std::unique_ptr<UpstreamApply> m_UpstreamApply; - - struct WorkerDesc - { - CbObject Descriptor; - }; - - [[nodiscard]] HttpResponseCode ExecActionUpstream(const WorkerDesc& Worker, CbObject& Object); - [[nodiscard]] HttpResponseCode ExecActionUpstreamResult(const IoHash& WorkerId, CbObject& Object); - - [[nodiscard]] HttpResponseCode ExecActionUpstream(const WorkerDesc& Worker, CbObject Action, CbObject& Object); - [[nodiscard]] HttpResponseCode ExecActionUpstreamResult(const IoHash& WorkerId, const IoHash& ActionId, CbPackage& Package); - - RwLock m_WorkerLock; - std::unordered_map<IoHash, WorkerDesc> m_WorkerMap; -}; - -} // namespace zen - -#endif // ZEN_WITH_COMPUTE_SERVICES |