// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include #include "hydration.h" namespace zen { /** ZenServer Hub Service * * Manages a set of storage servers on the behalf of external clients. For * use in UEFN content worker style scenarios. * */ class HttpHubService : public zen::HttpService { public: HttpHubService(std::filesystem::path HubBaseDir, std::filesystem::path ChildBaseDir); ~HttpHubService(); HttpHubService(const HttpHubService&) = delete; HttpHubService& operator=(const HttpHubService&) = delete; virtual const char* BaseUri() const override; virtual void HandleRequest(zen::HttpServerRequest& Request) override; void SetNotificationEndpoint(std::string_view UpstreamNotificationEndpoint, std::string_view InstanceId); /** Enable or disable the use of a Windows Job Object for child process management. * When enabled, all spawned child processes are assigned to a job object with * JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, ensuring children are terminated if the hub * crashes or is force-killed. Must be called before Initialize(). No-op on non-Windows. */ void SetUseJobObject(bool Enable); private: HttpRequestRouter m_Router; struct Impl; std::unique_ptr m_Impl; void HandleModuleGet(HttpServerRequest& Request, std::string_view ModuleId); void HandleModuleDelete(HttpServerRequest& Request, std::string_view ModuleId); }; } // namespace zen