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

Public Member Functions

 EventReceiver (std::uint64_t id, const std::shared_ptr< express::Response > &response)
 ~EventReceiver ()
std::shared_ptr< express::Response > getResponse () const
std::uint64_t getId () const

Private Attributes

std::uint64_t id
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 ( std::uint64_t id,
const std::shared_ptr< express::Response > & response )

Definition at line 247 of file SSEDistributor.cpp.

248 : id(id)
250 , heartbeatTimer(core::timer::Timer::intervalTimer(
251 [response] {
252 response->sendFragment(":keep-alive");
253 response->sendFragment();
254 },
255 39)) {
256 }
std::weak_ptr< express::Response > response

References heartbeatTimer, id, and response.

◆ ~EventReceiver()

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

Definition at line 258 of file SSEDistributor.cpp.

258 {
259 heartbeatTimer.cancel();
260 }

References heartbeatTimer.

Member Function Documentation

◆ getId()

std::uint64_t mqtt::bridge::lib::SSEDistributor::EventReceiver::getId ( ) const
inline

Definition at line 73 of file SSEDistributor.h.

73 {
74 return id;
75 }

References id.

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

Here is the caller graph for this function:

◆ getResponse()

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

Definition at line 262 of file SSEDistributor.cpp.

262 {
263 return response.lock();
264 }

References response.

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

Here is the caller graph for this function:

Member Data Documentation

◆ heartbeatTimer

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

Definition at line 81 of file SSEDistributor.h.

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

◆ id

std::uint64_t mqtt::bridge::lib::SSEDistributor::EventReceiver::id
private

Definition at line 78 of file SSEDistributor.h.

Referenced by EventReceiver(), and getId().

◆ response

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

Definition at line 79 of file SSEDistributor.h.

Referenced by EventReceiver(), and getResponse().


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