IMessageBus::Subscribe

Adds a subscription for published messages of the specified type.

Windows
MacOS
Linux

References

Module

Messaging

Header

/Engine/Source/Runtime/Messaging/Public/IMessageBus.h

Include

#include "IMessageBus.h"

Syntax

TSharedPtr< IMessageSubscription, ESPMode::ThreadSafe > Subscribe
(
    const TSharedRef< IMessageReceiver, ESPMode::ThreadSafe > & Subscriber,
    const FName & MessageType,
    const TRange< EMessageScope > & ScopeRange
)

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.

Returns

The added subscription, or nullptr if the subscription failed.

Parameters

Parameter

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.

See Also

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