AsyncThread

Execute a given function asynchronously using a separate thread.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Async/Async.h

Include

#include "Async/Async.h"

Syntax

template<typename CallableType>
auto AsyncThread
(
    CallableType && Callable,
    uint32 StackSize,
    EThreadPriority ThreadPri,
    TUniqueFunction< void()> CompletionCallback
)

Remarks

Execute a given function asynchronously using a separate thread.

Returns

A TFuture object that will receive the return value from the function.

Parameters

Parameter

Description

CallableType

The type of callable object.

Function

The function to execute.

StackSize

stack space to allocate for the new thread

ThreadPri

thread priority

CompletionCallback

An optional callback function that is executed when the function completed execution.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss