Navigation
API > API/Runtime > API/Runtime/Messaging
Interface for message senders.
Classes that implement this interface are able to send messages on a message bus. Each message sender must be uniquely identifiable with a message address that is returned by the IMessageSender.GetSenderAddress method. It is recommended that implementors of this interface generate a GUID for each instance, which must not change throughout the lifetime of the instance.
The sending of messages is accomplished with the IMessageBus.Forward, IMessageBus.Publish and IMessageBus.Send methods. In case an error occurs during the sending of a message, the IMessageSender.NotifyMessageError method will be called.
This interface provides a rather low-level mechanism for receiving messages. Instead of implementing it, Most users will want to use an instance of FMessageEndpoint, which provides a much more convenient way of sending and receiving messages.
| Name | IMessageSender |
| Type | class |
| Header File | /Engine/Source/Runtime/Messaging/Public/IMessageSender.h |
| Include Path | #include "IMessageSender.h" |
Syntax
class IMessageSender
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IMessageSender() |
Virtual destructor. | IMessageSender.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMessageAddress GetSenderAddress() |
Gets the sender's address. | IMessageSender.h | |
void NotifyMessageError
(
const TSharedRef< IMessageContext, ESPMode::ThreadSafe >& Context, |
Notifies the sender of errors. | IMessageSender.h |
See Also
-
FMessageEndpoint