Skip to content

Struct FLaunchableScriptRunnable

Struct FLaunchableScriptRunnable

  • Defined in File LaunchableScript.h

Inheritance Relationships

Base Type

  • public FRunnable
struct FLaunchableScriptRunnable : public FRunnable

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h Runnable task that executes a script in a background thread.

Handles script process management, including stdout/stderr pipe reading and logging.


Public Functions

SymbolDetails
FLaunchableScriptRunnableConstruct a runnable for the given script.
InitInitialize the runnable.
RunMain execution function that runs in the background thread.
ExitCalled when the thread exits.
StopCalled to stop the runnable execution.

FLaunchableScriptRunnable

FLaunchableScriptRunnable(FString ScriptURL, FString Args)

Construct a runnable for the given script.

Parameters

  • ScriptURL – [in] Path to the script to execute.

  • Args – [in] Command-line arguments for the script.

#DirectionNameTypeDescription
1ScriptURLFStringPath to the script to execute.
2ArgsFStringCommand-line arguments for the script.

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

Init

virtual bool Init() override

Initialize the runnable.

Called once before Run().

Returns:

True if initialization succeeded.

Attributes: virtual

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

Run

virtual uint32 Run() override

Main execution function that runs in the background thread.

Returns:

Exit code from the thread.

Attributes: virtual

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

Exit

virtual void Exit() override

Called when the thread exits.

Attributes: virtual

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp

Stop

virtual void Stop() override

Called to stop the runnable execution.

Attributes: virtual

Source: Source/Schola/Training/Public/TrainingUtils/LaunchableScript.h

Implementation: Source/Schola/Training/Private/TrainingUtils/LaunchableScript.cpp


Public Members

SymbolDetails
ScriptURLPath to the script to execute.
ArgsCommand-line arguments for the script.
ReadStdErrPipePipe for reading stderr from the script process.
WriteStdErrPipePipe for writing stderr to the script process.
ReadStdOutPipePipe for reading stdout from the script process.
WriteStdOutPipePipe for writing stdout to the script process.
ProcessHandleHandle to the running script process.

ScriptURL

FString ScriptURL

Path to the script to execute.


Args

FString Args

Command-line arguments for the script.


ReadStdErrPipe

void *ReadStdErrPipe = nullptr

Pipe for reading stderr from the script process.


WriteStdErrPipe

void *WriteStdErrPipe = nullptr

Pipe for writing stderr to the script process.


ReadStdOutPipe

void *ReadStdOutPipe = nullptr

Pipe for reading stdout from the script process.


WriteStdOutPipe

void *WriteStdOutPipe = nullptr

Pipe for writing stdout to the script process.


ProcessHandle

FProcHandle ProcessHandle

Handle to the running script process.