|
DelegateMQ
|
A thread-safe monitor for tracking outgoing remote messages and detecting timeouts. More...
#include <TransportMonitor.h>
Public Types | |
| enum class | Status { SUCCESS , TIMEOUT } |
Public Member Functions | |
| TransportMonitor (const dmq::Duration timeout) | |
| ~TransportMonitor () | |
| virtual void | Add (uint16_t seqNum, dmq::DelegateRemoteId remoteId) override |
| virtual void | Remove (uint16_t seqNum) override |
| void | Process () |
| Call periodically to process message timeouts. | |
Public Member Functions inherited from ITransportMonitor | |
Public Attributes | |
| std::shared_ptr< dmq::SignalSafe< void(dmq::DelegateRemoteId, uint16_t, Status)> > | OnSendStatus |
A thread-safe monitor for tracking outgoing remote messages and detecting timeouts.
The TransportMonitor implements the reliability layer for remote delegate invocations. It tracks "in-flight" messages by their sequence number and timestamps them upon sending.
Key Responsibilities:
TRANSPORT_TIMEOUT duration.SendStatusCb delegate with Status::SUCCESS (upon ACK) or Status::TIMEOUT (upon expiration) to notify the application.Usage Note: This class relies on a cooperative polling model. The Process() method must be called periodically (typically by a background timer or the network thread loop) to scan for and handle expired messages.
|
strong |
|
inline |
|
inline |
|
inlineoverridevirtual |
Add a sequence number param[in] seqNum - the delegate message sequence number param[in] remoteId - the remote ID
Implements ITransportMonitor.
|
inline |
Call periodically to process message timeouts.
|
inlineoverridevirtual |
Remove a sequence number. Invokes SendStatusCb callback to notify registered client of removal. param[in] seqNum - the delegate message sequence number
Implements ITransportMonitor.
| std::shared_ptr<dmq::SignalSafe<void(dmq::DelegateRemoteId, uint16_t, Status)> > TransportMonitor::OnSendStatus |
Signal emitted when a message status is determined. Subscribers receive: (remoteId, seqNum, status) Use a shared_ptr for the signal as required by SignalSafe