#include <testStoreSupport.h>

Inheritance diagram for StockEventLoop:
Collaboration diagram for StockEventLoop:

Public Member Functions

 StockEventLoop ()
void registerEngine (AsyncEngine *engine)
void run ()
bool runOnce ()
void setPrimaryEngine (AsyncEngine *engine)
void setTimeService (TimeEngine *engine)
void stop ()

Public Attributes

TimeEngine default_time_engine
int errcount

Static Public Attributes

static EventLoopRunning = NULL

Detailed Description

Definition at line 19 of file testStoreSupport.h.

Constructor & Destructor Documentation

StockEventLoop::StockEventLoop ( )

Member Function Documentation

void EventLoop::registerEngine ( AsyncEngine engine)

register an async engine which will be given the opportunity to perform in-main-thread tasks each event loop.

Definition at line 70 of file EventLoop.cc.

References EventLoop::engines.

Referenced by Adaptation::Ecap::ServiceRep::makeXactLauncher(), SquidMain(), StockEventLoop(), and testEventLoop::testSetPrimaryEngine().

void EventLoop::run ( )

start the event loop running. The loop will run until it is stopped by calling stop(), or when the loop is completely idle - nothing dispatched in a loop, and all engines idle.

Definition at line 76 of file EventLoop.cc.

References assert, NULL, EventLoop::prepareToRun(), EventLoop::Running, and EventLoop::runOnce().

Referenced by SquidMain(), testRock::storeInit(), and testRock::testRockSwapOut().

bool EventLoop::runOnce ( )

run the loop once. This may not complete all events! It should therefor be used with care. TODO: signal in runOnce whether or not the loop is over - IDLE vs OK vs TIMEOUT?

Definition at line 89 of file EventLoop.cc.

References EventLoop::checkEngine(), DBG_CRITICAL, debugs, EventLoop::dispatchCalls(), EventLoop::engines, EventLoop::errcount, EventLoop::error, EVENT_LOOP_TIMEOUT, i, EventLoop::last_loop, EventLoop::loop_delay, NULL, EventLoop::primaryEngine, EventLoop::runOnceResult, TimeEngine::tick(), and EventLoop::timeService.

Referenced by EventLoop::run(), testEventLoop::testSetPrimaryEngine(), testEventLoop::testSetTimeService(), and testUfs::testUfsSearch().

void EventLoop::setPrimaryEngine ( AsyncEngine engine)

set the primary async engine. The primary async engine recieves the lowest requested timeout gathered from the other engines each loop. (There is a default of 10ms if all engines are idle or request higher delays). If no primary has been nominated, the last async engine added is implicitly the default.

Definition at line 149 of file EventLoop.cc.

References EventLoop::engines, fatal(), i, and EventLoop::primaryEngine.

Referenced by SquidMain(), and testEventLoop::testSetPrimaryEngine().

void EventLoop::setTimeService ( TimeEngine engine)

set the time service. There can be only one time service set at any time. The time service is invoked on each loop

Definition at line 162 of file EventLoop.cc.

References EventLoop::timeService.

Referenced by SquidMain(), StockEventLoop(), and testEventLoop::testSetTimeService().

void EventLoop::stop ( )

stop the event loop - it will finish the current loop and then return to the caller of run().

Definition at line 168 of file EventLoop.cc.

References EventLoop::last_loop.

Referenced by SignalEngine::StopEventLoop().

Member Data Documentation

TimeEngine StockEventLoop::default_time_engine

Definition at line 24 of file testStoreSupport.h.

Referenced by StockEventLoop().

int EventLoop::errcount

Definition at line 68 of file EventLoop.h.

Referenced by EventLoop::prepareToRun(), EventLoop::runOnce(), and SquidMain().

EventLoop * EventLoop::Running = NULL

the [main program] loop running now; may be nil for simplicity, we assume there are no concurrent loops

Definition at line 72 of file EventLoop.h.

Referenced by Adaptation::Ecap::ServiceRep::makeXactLauncher(), EventLoop::run(), and SignalEngine::StopEventLoop().

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






Web Site Translations