Choose your operating system:
Windows
macOS
Linux
| FRunnable | ||
| FSingleThreadRunnable
|
Module |
|
Header |
/Engine/Plugins/Online/OnlineSubsystem/Source/Public/OnlineAsyncTaskManager.h |
Include |
#include "OnlineAsyncTaskManager.h" |
class FOnlineAsyncTaskManager :
public FRunnable,
private FSingleThreadRunnable
The foundation of all async operations in every online subsystem
A task manager ticks on its own thread, managing both a serial and parallel queue of FOnlineAsyncTasks Each task works through the serial queue in the following manner GameThread
Initialize() OnlineThread Tick() until IsDone() Add task to OutQueue GameThread
TriggerDelegates()
Parallel task queue works in a similar flow, except the tasks don't wait for any previous tasks to complete
Name | Description | ||
---|---|---|---|
|
std::atomic< bo... |
bReloadMaxParallelTasksConfig |
Signal game thread to reload the MaxParallelTasks value from config |
|
bRequestingExit |
Should this manager and the thread exit |
|
|
InQueue |
Game thread async tasks are queued up here for processing on the online thread |
|
|
InQueueLock |
Critical section for thread safe operation of the event in queue |
|
|
MaxParallelTasks |
Number of tasks that can run in parallel |
|
|
OnlineThreadId |
Set by FOnlineAsyncTaskManager::Run |
|
|
OutQueue |
Completed online requests are queued up here for processing on the game thread |
|
|
OutQueueLock |
Critical section for thread safe operation of the out queue |
|
|
ParallelTasks |
Tasks that are running in parallel |
|
|
ParallelTasksLock |
Critical section for thread safe operation of the list |
|
|
PollingInterval |
Min amount of time to poll for the current task to complete |
|
|
QueuedParallelTasks |
This queue is for tasks that are safe to run in parallel with one another |
|
|
FEvent * |
WorkEvent |
Trigger event to signal the queue has tasks that need processing |
Name | Description | |
---|---|---|
|
FOnlineAsyncTaskManager() |
Name | Description | |
---|---|---|
|
~FOnlineAsyncTaskManager() |
Name | Description | ||
---|---|---|---|
|
AddGenericToInQueue ( |
Add a new item to the in queue that will call InCallable on the game thread. |
|
|
AddGenericToInQueueOnlineThread ( |
Add a new item to the in queue that will call InCallable on the ONLINE thread. |
|
|
AddGenericToOutQueue ( |
Add a new item to the out queue that will call InCallable on the game thread. |
|
|
AddToInQueue ( |
Add online async tasks that need processing onto the incoming queue |
|
|
AddToOutQueue ( |
Add completed online async tasks that need processing onto the queue |
|
|
AddToParallelTasks ( |
Add a new online async task that is safe to run in parallel |
|
|
GameTick() |
CALL ONLY FROM GAME THREAD ** Give the completed async tasks a chance to marshal their data back onto the game thread Calling delegates where appropriate |
|
|
OnlineTick() |
CALL ONLY FROM ONLINE THREAD ** Give the online service a chance to do work |
|
|
RemoveFromParallelTasks ( |
Remove a parallel async task from the parallel queue |
Name | Description | ||
---|---|---|---|
|
Exit() |
Called in the context of the aggregating thread to perform any cleanup. |
|
|
FSingleThrea... |
GetSingleThreadInterface() |
FSingleThreadRunnable accessor for ticking this FRunnable when multi-threading is disabled. |
|
Init() |
Init the online async task manager |
|
|
Run() |
This is where all per object thread work is done. |
|
|
Stop() |
This is called if a thread is requested to terminate early |
Name |
Description |
---|---|
InvocationCount |
Number of async task managers running currently |