28 #ifndef AsyncComm_RequestCache_h
29 #define AsyncComm_RequestCache_h
34 #include <unordered_map>
57 : id(id), handler(handler), dh(dh) {}
127 #endif // AsyncComm_RequestCache_h
CacheNode * m_head
Head of doubly-linked list.
void purge_requests(IOHandler *handler, int32_t error)
Purges all requests assocated with handler.
CacheNode(uint32_t id, IOHandler *handler, DispatchHandler *dh)
Class used to hold pending request callback handlers.
chrono::time_point< fast_clock > time_point
Abstract base class for application dispatch handlers registered with AsyncComm.
CacheNode * next
Doubly-linked list pointers.
Internal cache node structure.
IdHandlerMap m_id_map
RequestID-to-CacheNode map.
Declarations for DispatchHandler.
std::unordered_map< uint32_t, CacheNode * > IdHandlerMap
RequestID-to-CacheNode map.
IOHandler * handler
IOHandler associated with this request.
Base class for socket descriptor I/O handlers.
ClockT::time_point expire
Absolute expiration time.
void insert(uint32_t id, IOHandler *handler, DispatchHandler *dh, ClockT::time_point &expire)
Inserts pending request callback handler into cache.
CacheNode * m_tail
Tail of doubly-linked list.
DispatchHandler * dh
Callback handler to which MESSAGE, TIMEOUT, ERROR, and DISCONNECT events are delivered.
RequestCache()
Constructor.
bool get_next_timeout(ClockT::time_point &now, IOHandler *&handlerp, DispatchHandler *&dh, ClockT::time_point *next_timeout)
Removes next request that has timed out.