Thread functor class for reacting to I/O events. More...
#include <ReactorRunner.h>
Public Member Functions | |
void | operator() () |
Primary thread entry point. More... | |
void | set_reactor (ReactorPtr &reactor) |
Assocates reactor state object with this ReactorRunner. More... | |
Static Public Attributes | |
static bool | shutdown = false |
Flag indicating that reactor thread is being shut down. More... | |
static bool | record_arrival_time = false |
If set to true arrival time is recorded and passed into IOHandler::handle. More... | |
static HandlerMapPtr | handler_map |
Smart pointer to HandlerMap. More... | |
Private Member Functions | |
void | cleanup_and_remove_handlers (std::set< IOHandler * > &handlers) |
Cleans up and removes a set of handlers. More... | |
Private Attributes | |
ReactorPtr | m_reactor |
Smart pointer to reactor state object. More... | |
Thread functor class for reacting to I/O events.
The AsyncComm layer is initialized with some number of reactor threads (see ReactorFactory::initialize). The ReactorRunner class acts as the thread function for these reactor threads. The primary function of a reactor thread is to wait for I/O events (e.g. read/write readiness) to occur on a set of registered socket descriptors and then call into the associated IOHandler objects to handle the I/O events. It also handles cleanup and removal of sockets that have been disconnected.
Definition at line 51 of file ReactorRunner.h.
|
private |
Cleans up and removes a set of handlers.
For each handler in handlers
, this method destroys the handler in the HandlerMap, cancels any outstanding requests on the handler, removes polling interest from polling mechanism, an purges the handler from the HandlerMap.
handlers | Set of IOHandlers to remove |
Definition at line 300 of file ReactorRunner.cc.
void ReactorRunner::operator() | ( | ) |
Primary thread entry point.
Definition at line 67 of file ReactorRunner.cc.
|
inline |
Assocates reactor state object with this ReactorRunner.
reactor | Reference to smart pointer to reactor state object |
Definition at line 60 of file ReactorRunner.h.
|
static |
Smart pointer to HandlerMap.
Definition at line 70 of file ReactorRunner.h.
|
private |
Smart pointer to reactor state object.
Definition at line 83 of file ReactorRunner.h.
|
static |
If set to true arrival time is recorded and passed into IOHandler::handle.
Definition at line 67 of file ReactorRunner.h.
|
static |
Flag indicating that reactor thread is being shut down.
Definition at line 63 of file ReactorRunner.h.