Navigation
API > API/Plugins > API/Plugins/AsyncMessageSystem
A single async message which has been queued for broadcasting, and listeners are interested in receiving the data from.
Async Message Messages contain some data about when, where, and how the message was queued which make it possible to synchronize game state across multiple threads with messages.
| Name | FAsyncMessage |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/AsyncMessageSystem/Source/AsyncMessageSystem/Public/AsyncMessage.h |
| Include Path | #include "AsyncMessage.h" |
Syntax
USTRUCT (BlueprintType )
struct FAsyncMessage
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAsyncMessage
(
const FAsyncMessageId& MessageId, |
AsyncMessage.h | ||
| AsyncMessage.h |
Structs
| Name | Remarks |
|---|---|
| FMessageDebugData | TODO: We could perhaps define a "lifetime" concept on these messages, similar to how AnimNext's TraitEvents (TraitEvent.h) work, as well as consumption perhaps? |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BindingEndpoint | TWeakPtr< FAsyncMessageBindingEndpoint > | Pointer to which endpoint this message should be broadcast on. | AsyncMessage.h | |
| DebugData | FMessageDebugData * | AsyncMessage.h | ||
| MessageId | FAsyncMessageId | The Async message Id which this message is a part of. | AsyncMessage.h |
|
| MessageSourceId | FAsyncMessageId | The source of this message. | AsyncMessage.h |
|
| PayloadCopy | FInstancedStruct | A copy of the payload data that is created upon construction of this message. | AsyncMessage.h |
|
| QueueFrame | uint64 | The frame at which this message was queued ( GFrameCounter ) | AsyncMessage.h | |
| QueueTime | double | The time at which this message was queued ( FApp::GetCurrentTime() ) | AsyncMessage.h |
|
| SequenceId | uint32 | The sequence of this specific message if there were multiple in the message queue at one time. | AsyncMessage.h | |
| ThreadQueuedFrom | uint32 | The ThreadId from which this message was queued from ( FPlatformTLS::GetCurrentThreadId() ) | AsyncMessage.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddReferencedObjects
(
FReferenceCollector& Collector |
AsyncMessage.h | ||
TSharedPtr< FAsyncMessageBindingEndpoint > GetBindingEndpoint() |
Returns the endpoint which this message should be broadcast on. | AsyncMessage.h | |
const FString & GetBlueprintScriptCallstack() |
AsyncMessage.h | ||
const uint32 GetDebugMessageId() |
AsyncMessage.h | ||
FAsyncMessageId GetMessageId() |
Returns this message's unique ID which listeners use to bind to it. | AsyncMessage.h | |
FAsyncMessageId GetMessageSourceId() |
Returns this the source message which caused this message to be queued | AsyncMessage.h | |
const FString & GetNativeCallstack() |
AsyncMessage.h | ||
TDataType * GetPayloadData() |
Returns the typed data pointer of this message's payload. Nullptr if the payload is invalid. | AsyncMessage.h | |
| Get the const payload data associated with this async message. | AsyncMessage.h | ||
| Get the mutable payload data associated with this async message. | AsyncMessage.h | ||
uint64 GetQueueFrame() |
Returns the frame (GFrameNumber) of which this message was queued for broadcast. | AsyncMessage.h | |
double GetQueueTimestamp() |
Returns the timestamp which this message message was queued on. | AsyncMessage.h | |
uint32 GetSequenceId () |
Returns the “sequence ID” of this message. | AsyncMessage.h | |
uint32 GetThreadQueuedFromThreadId() |
Returns the thread Id from which this message was queued from ( FPlatformTLS::GetCurrentThreadId() ) | AsyncMessage.h | |
void SetDebugData
(
FMessageDebugData* InData |
AsyncMessage.h | ||
void SetMessageId
(
const FAsyncMessageId& NewMessageId |
Sets the current message id which this FAsyncMessage represents to another message | AsyncMessage.h |