0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Hypertable::ReactorRunner Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

void ReactorRunner::cleanup_and_remove_handlers ( std::set< IOHandler * > &  handlers)
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.

Parameters
handlersSet 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.

void Hypertable::ReactorRunner::set_reactor ( ReactorPtr reactor)
inline

Assocates reactor state object with this ReactorRunner.

Parameters
reactorReference to smart pointer to reactor state object

Definition at line 60 of file ReactorRunner.h.

Member Data Documentation

HandlerMapPtr Hypertable::ReactorRunner::handler_map
static

Smart pointer to HandlerMap.

Definition at line 70 of file ReactorRunner.h.

ReactorPtr Hypertable::ReactorRunner::m_reactor
private

Smart pointer to reactor state object.

Definition at line 83 of file ReactorRunner.h.

bool Hypertable::ReactorRunner::record_arrival_time = false
static

If set to true arrival time is recorded and passed into IOHandler::handle.

Definition at line 67 of file ReactorRunner.h.

bool Hypertable::ReactorRunner::shutdown = false
static

Flag indicating that reactor thread is being shut down.

Definition at line 63 of file ReactorRunner.h.


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