Skip to content

FLaunchableScriptRunnable

Runnable task that executes a script in a background thread.

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

struct FLaunchableScriptRunnable : public FRunnable

Methods

FLaunchableScriptRunnable

FLaunchableScriptRunnable(FString ScriptURL, FString Args)

Construct a runnable for the given script.

Parameters

  • ScriptURL (FString)

  • Args (FString)


Init

virtual bool Init() override

Initialize the runnable.


Run

virtual uint32 Run() override

Main execution function that runs in the background thread.


Exit

virtual void Exit() override

Called when the thread exits.


Stop

virtual void Stop() override

Called to stop the runnable execution.

Attributes

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.

Source: Source/ScholaTraining/Public/TrainingUtils/LaunchableScript.h