29 #ifndef AsyncComm_ApplicationHandler_h
30 #define AsyncComm_ApplicationHandler_h
93 virtual void run() = 0;
118 uint32_t wait_ms = (uint32_t)std::chrono::duration_cast<std::chrono::milliseconds>(now -
m_event->arrival_time).count();
119 if (wait_ms >=
m_event->header.timeout_ms) {
121 HT_WARNF(
"Request expired, wait time %u > timeout %u",
122 (
unsigned)wait_ms,
m_event->header.timeout_ms);
124 HT_WARNF(
"Response expired, wait time %u > timeout %u", (
unsigned)wait_ms,
127 if (
m_event->header.timeout_ms == 0) {
128 HT_INFO(
"Changing zero timeout request to 120000 ms");
129 m_event->header.timeout_ms = 120000;
146 #endif // AsyncComm_ApplicationHandler_h
#define HT_WARNF(msg,...)
Declarations for ReactorRunner.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
ApplicationHandler(EventPtr &event)
Constructor initializing from an Event object.
uint64_t get_group_id()
Returns the group ID that this handler belongs to.
static bool record_arrival_time
If set to true arrival time is recorded and passed into IOHandler::handle.
static time_point now() noexcept
virtual ~ApplicationHandler()
Destructor.
bool is_expired()
Returns true if request has expired.
ApplicationHandler(bool urgent=false)
Default constructor with m_urgent flag initialization.
virtual void run()=0
Carries out the request.
Request/response message event.
Base clase for application handlers.
EventPtr m_event
MESSAGE Event from which handler was initialized.
bool m_urgent
Flag indicating if handler is urgent.
bool is_urgent()
Returns true if request is urgent.