Class used to hold pending request callback handlers. More...
#include <RequestCache.h>
Classes | |
class | CacheNode |
Internal cache node structure. More... | |
Public Member Functions | |
RequestCache () | |
Constructor. More... | |
void | insert (uint32_t id, IOHandler *handler, DispatchHandler *dh, ClockT::time_point &expire) |
Inserts pending request callback handler into cache. More... | |
bool | remove (uint32_t id, DispatchHandler *&handler) |
Removes a request from the cache. More... | |
bool | get_next_timeout (ClockT::time_point &now, IOHandler *&handlerp, DispatchHandler *&dh, ClockT::time_point *next_timeout) |
Removes next request that has timed out. More... | |
void | purge_requests (IOHandler *handler, int32_t error) |
Purges all requests assocated with handler . More... | |
Private Types | |
typedef std::unordered_map < uint32_t, CacheNode * > | IdHandlerMap |
RequestID-to-CacheNode map. More... | |
Private Attributes | |
IdHandlerMap | m_id_map |
RequestID-to-CacheNode map. More... | |
CacheNode * | m_head |
Head of doubly-linked list. More... | |
CacheNode * | m_tail {} |
Tail of doubly-linked list. More... | |
Class used to hold pending request callback handlers.
One RequestCache object is associated with each Reactor. When a request is sent (see Comm::send_request) an entry, which includes the response handler, is inserted into the RequestCache. When the corresponding response is receive, the response handler is obtained by looking up the corresponding request ID in this cache.
Definition at line 50 of file RequestCache.h.