FAsyncWriter

Provides a thread-safe serialization interface with a background thread doing the actual writes.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/OutputDeviceFile.h

Include

#include "Misc/OutputDeviceFile.h"

Syntax

class FAsyncWriter :
    public FRunnable,
    public FSingleThreadRunnable,
    public FArchive

Remarks

Provides a thread-safe serialization interface with a background thread doing the actual writes. [] tags identify which thread owns a variable or function

Constructors

Name Description

Public function

FAsyncWriter

(
    FArchive& InAr,
    FAsyncWriter::EThreadNameOption Nam...
)

Destructors

Name Description

Public function Virtual

~FAsyncWriter()

Overridden from FRunnable

Name Description

Public function Virtual

FSingleThrea...

 

GetSingleThreadInterface()

Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled.

Public function Virtual

bool

 

Init()

Initializes the runnable object.

Public function Virtual

uint32

 

Run()

Runs the runnable object.

Public function Virtual

void

 

Stop()

Stops the runnable object.

This is called if a thread is requested to terminate early.

Overridden from FSingleThreadRunnable

Name Description

Protected function Virtual

void

 

Tick()

[CLIENT THREAD] A substitute for Run() for when threading is disabled.

Overridden from FArchive

Name Description

Public function Virtual

void

 

Flush()

Flush all buffers to disk

Public function Virtual

void

 

Serialize

(
    void* InData,
    int64 Length
)

[CLIENT THREAD] Serialize data to buffer that will later be saved to disk by the async thread

Enums

Name

Description

Private enum

EConstants

Public enum

EThreadNameOption