blob: ef24bba6931e67979fc25e2d6c362fc9c3abf85b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include <zenhttp/httpserver.h>
#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<Impl> m_Impl;
void HandleModuleGet(HttpServerRequest& Request, std::string_view ModuleId);
void HandleModuleDelete(HttpServerRequest& Request, std::string_view ModuleId);
};
} // namespace zen
|