#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 (Time::Engine *)
 
void stop ()
 

Public Attributes

Time::Engine default_time_engine
 
int errcount
 

Static Public Attributes

static EventLoopRunning = nullptr
 

Private Types

typedef std::vector< AsyncEngine * > engine_vector
 

Private Member Functions

void prepareToRun ()
 
void checkEngine (AsyncEngine *engine, bool const primary)
 
bool dispatchCalls ()
 

Private Attributes

bool last_loop
 
engine_vector engines
 
Time::EnginetimeService
 
AsyncEngineprimaryEngine
 
int loop_delay
 
bool error
 
bool runOnceResult
 

Detailed Description

Definition at line 19 of file testStoreSupport.h.

Member Typedef Documentation

◆ engine_vector

typedef std::vector<AsyncEngine *> EventLoop::engine_vector
privateinherited

Definition at line 86 of file EventLoop.h.

Constructor & Destructor Documentation

◆ StockEventLoop()

StockEventLoop::StockEventLoop ( )

Member Function Documentation

◆ checkEngine()

void EventLoop::checkEngine ( AsyncEngine engine,
bool const  primary 
)
privateinherited

◆ dispatchCalls()

bool EventLoop::dispatchCalls ( )
privateinherited

dispatch calls and events scheduled during checkEngine()

Definition at line 142 of file EventLoop.cc.

References AsyncCallQueue::fire(), and AsyncCallQueue::Instance().

Referenced by EventLoop::runOnce().

◆ prepareToRun()

void EventLoop::prepareToRun ( )
privateinherited

setup state variables prior to running

Definition at line 63 of file EventLoop.cc.

References EventLoop::errcount, and EventLoop::last_loop.

Referenced by EventLoop::run().

◆ registerEngine()

void EventLoop::registerEngine ( AsyncEngine engine)
inherited

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 StockEventLoop(), Adaptation::Ecap::ServiceRep::makeXactLauncher(), SquidMain(), TestEventLoop::testEngineErrors(), TestEventLoop::testEngineTimeout(), TestEventLoop::testRunOnce(), and TestEventLoop::testSetPrimaryEngine().

◆ run()

void EventLoop::run ( )
inherited

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, EventLoop::prepareToRun(), EventLoop::Running, and EventLoop::runOnce().

Referenced by SquidMain(), TestRock::storeInit(), TestEventLoop::testEngineErrors(), TestRock::testRockSwapOut(), and TestEventLoop::testRunOnce().

◆ runOnce()

◆ setPrimaryEngine()

void EventLoop::setPrimaryEngine ( AsyncEngine engine)
inherited

set the primary async engine. The primary async engine receives 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(), and EventLoop::primaryEngine.

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

◆ setTimeService()

void EventLoop::setTimeService ( Time::Engine engine)
inherited

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 StockEventLoop(), SquidMain(), and TestEventLoop::testSetTimeService().

◆ stop()

void EventLoop::stop ( )
inherited

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

◆ default_time_engine

Time::Engine StockEventLoop::default_time_engine

Definition at line 24 of file testStoreSupport.h.

Referenced by StockEventLoop().

◆ engines

engine_vector EventLoop::engines
privateinherited

◆ errcount

int EventLoop::errcount
inherited

◆ error

bool EventLoop::error
privateinherited

has an error occurred in this loop

Definition at line 91 of file EventLoop.h.

Referenced by EventLoop::checkEngine(), and EventLoop::runOnce().

◆ last_loop

bool EventLoop::last_loop
privateinherited

Definition at line 85 of file EventLoop.h.

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

◆ loop_delay

int EventLoop::loop_delay
privateinherited

the delay to be given to the primary engine

Definition at line 90 of file EventLoop.h.

Referenced by EventLoop::checkEngine(), and EventLoop::runOnce().

◆ primaryEngine

AsyncEngine* EventLoop::primaryEngine
privateinherited

Definition at line 89 of file EventLoop.h.

Referenced by EventLoop::runOnce(), and EventLoop::setPrimaryEngine().

◆ Running

EventLoop * EventLoop::Running = nullptr
staticinherited

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

Definition at line 73 of file EventLoop.h.

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

◆ runOnceResult

bool EventLoop::runOnceResult
privateinherited

the result from runOnce

Definition at line 92 of file EventLoop.h.

Referenced by EventLoop::checkEngine(), and EventLoop::runOnce().

◆ timeService

Time::Engine* EventLoop::timeService
privateinherited

Definition at line 88 of file EventLoop.h.

Referenced by EventLoop::runOnce(), and EventLoop::setTimeService().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors