You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb simon.therriault #jira UETOOL-4463 #preflight 62424a85c61d8a458f223a59 [CL 19540648 by George Rolfe in ue5-main branch]
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include <atomic>
|
|
#include "Containers/UnrealString.h"
|
|
#include "HAL/PlatformProcess.h"
|
|
#include "HAL/Runnable.h"
|
|
#include "HAL/RunnableThread.h"
|
|
#include "Misc/AsyncTaskNotification.h"
|
|
|
|
class FWebAPILiquidJSProcess : private FRunnable
|
|
{
|
|
public:
|
|
enum class EStatus : uint8
|
|
{
|
|
Stopped = 0,
|
|
Error = 1,
|
|
|
|
Launching = 2,
|
|
Running = 3,
|
|
};
|
|
|
|
public:
|
|
FWebAPILiquidJSProcess();
|
|
|
|
virtual ~FWebAPILiquidJSProcess();
|
|
|
|
/** Starts the webapp external process, first launch will take some time as it needs to compile the webapp */
|
|
bool TryStart();
|
|
|
|
/** Shutdown the webapp external process */
|
|
void Shutdown();
|
|
|
|
/** Get the webapp's status. */
|
|
EStatus GetStatus() const;
|
|
|
|
/** Enable / disable external logger */
|
|
void SetExternalLoggerEnabled(bool bEnableExternalLog) const;
|
|
|
|
protected:
|
|
virtual uint32 Run() override;
|
|
|
|
private:
|
|
/** Plugin root folder */
|
|
FString Root;
|
|
|
|
/** WebApp Node.js process handle */
|
|
FProcHandle Process;
|
|
|
|
/** Thread for WebApp node.js process (read stdout and forward to log) */
|
|
FRunnableThread* Thread = nullptr;
|
|
|
|
/** Progress notification */
|
|
TUniquePtr<FAsyncTaskNotification> TaskNotification;
|
|
|
|
/** The current status of the web app. */
|
|
std::atomic<EStatus> Status;
|
|
}; |