Navigation
API > API/Runtime > API/Runtime/Messaging > API/Runtime/Messaging/IMessageBus > API/Runtime/Messaging/IMessageBus/Subscribe
Deprecated * Types names are now represented by path names. Please use a version of this function that takes an FTopLevelAssetPath as MessageType.
References
Module | Messaging |
Header | /Engine/Source/Runtime/Messaging/Public/IMessageBus.h |
Include | #include "IMessageBus.h" |
Source | /Engine/Source/Runtime/Messaging/Private/Bus/MessageBus.cpp |
virtual TSharedPtr< IMessageSubscription, ESPMode::ThreadSafe > Subscribe
&40;
const TSharedRef< IMessageReceiver, ESPMode::ThreadSafe > & Subscriber,
const FName & MessageType,
const TRange< EMessageScope > & ScopeRange
&41;
Remarks
Adds a subscription for published messages of the specified type.
Subscriptions allow message consumers to receive published messages from the message bus. The returned interface can be used to query the subscription's details and its enabled state. The added subscription, or nullptr if the subscription failed.
Parameters
Name | Description |
---|---|
Subscriber | The subscriber wishing to receive the messages. |
MessageType | The type of messages to subscribe to (NAME_All = subscribe to all message types). |
ScopeRange | The range of message scopes to include in the subscription. |