UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TAsyncRunnable< ResultType > Class Template Reference

#include <Async.h>

+ Inheritance diagram for TAsyncRunnable< ResultType >:

Public Member Functions

 TAsyncRunnable (TUniqueFunction< ResultType()> &&InFunction, TPromise< ResultType > &&InPromise, TFuture< FRunnableThread * > &&InThreadFuture)
 
virtual uint32 Run () override
 
- Public Member Functions inherited from FRunnable
virtual bool Init ()
 
virtual void Stop ()
 
virtual void Exit ()
 
virtual class FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Detailed Description

template<typename ResultType>
class TAsyncRunnable< ResultType >

Template for asynchronous functions that are executed in a separate thread.

Constructor & Destructor Documentation

◆ TAsyncRunnable()

template<typename ResultType >
TAsyncRunnable< ResultType >::TAsyncRunnable ( TUniqueFunction< ResultType()> &&  InFunction,
TPromise< ResultType > &&  InPromise,
TFuture< FRunnableThread * > &&  InThreadFuture 
)
inline

Creates and initializes a new instance.

Parameters
InFunctionThe function to execute asynchronously.
InPromiseThe promise object used to return the function's result.
InThreadFutureThe thread that is running this task.

Member Function Documentation

◆ Run()

template<typename ResultType >
uint32 TAsyncRunnable< ResultType >::Run ( )
overridevirtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

Returns
The exit code of the runnable object
See also
Init, Stop, Exit

Implements FRunnable.


The documentation for this class was generated from the following file: