MQTTSuite
Loading...
Searching...
No Matches
mqtt::bridge::lib::SSEDistributor::EventReceiver Class Reference
Collaboration diagram for mqtt::bridge::lib::SSEDistributor::EventReceiver:

Public Member Functions

 EventReceiver (const std::shared_ptr< express::Response > &response)
 ~EventReceiver ()
std::shared_ptr< express::Response > getResponse () const
bool operator== (const EventReceiver &other)

Private Attributes

std::weak_ptr< express::Response > response
core::timer::Timer heartbeatTimer

Detailed Description

Definition at line 65 of file SSEDistributor.h.

Constructor & Destructor Documentation

◆ EventReceiver()

mqtt::bridge::lib::SSEDistributor::EventReceiver::EventReceiver ( const std::shared_ptr< express::Response > & response)

Definition at line 243 of file SSEDistributor.cpp.

245 , heartbeatTimer(core::timer::Timer::intervalTimer(
246 [response] {
247 response->sendFragment(":keep-alive");
248 response->sendFragment();
249 },
250 39)) {
251 }
std::weak_ptr< express::Response > response

References heartbeatTimer, and response.

◆ ~EventReceiver()

mqtt::bridge::lib::SSEDistributor::EventReceiver::~EventReceiver ( )

Definition at line 253 of file SSEDistributor.cpp.

253 {
254 heartbeatTimer.cancel();
255 }

References heartbeatTimer.

Member Function Documentation

◆ getResponse()

std::shared_ptr< express::Response > mqtt::bridge::lib::SSEDistributor::EventReceiver::getResponse ( ) const

Definition at line 257 of file SSEDistributor.cpp.

257 {
258 return response.lock();
259 }

References response.

Referenced by mqtt::bridge::lib::SSEDistributor::sendEvent().

Here is the caller graph for this function:

◆ operator==()

bool mqtt::bridge::lib::SSEDistributor::EventReceiver::operator== ( const EventReceiver & other)

Definition at line 261 of file SSEDistributor.cpp.

261 {
262 return response.lock() == other.response.lock();
263 }

References response.

Member Data Documentation

◆ heartbeatTimer

core::timer::Timer mqtt::bridge::lib::SSEDistributor::EventReceiver::heartbeatTimer
private

Definition at line 78 of file SSEDistributor.h.

Referenced by EventReceiver(), and ~EventReceiver().

◆ response

std::weak_ptr<express::Response> mqtt::bridge::lib::SSEDistributor::EventReceiver::response
private

Definition at line 76 of file SSEDistributor.h.

Referenced by EventReceiver(), getResponse(), and operator==().


The documentation for this class was generated from the following files: