#include <testStoreSupport.h>
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 EventLoop * | Running = 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::Engine * | timeService |
AsyncEngine * | primaryEngine |
int | loop_delay |
bool | error |
bool | runOnceResult |
Detailed Description
Definition at line 19 of file testStoreSupport.h.
Member Typedef Documentation
◆ engine_vector
|
privateinherited |
Definition at line 86 of file EventLoop.h.
Constructor & Destructor Documentation
◆ StockEventLoop()
StockEventLoop::StockEventLoop | ( | ) |
Definition at line 17 of file testStoreSupport.cc.
References default_time_engine, EventScheduler::GetInstance(), EventLoop::registerEngine(), and EventLoop::setTimeService().
Member Function Documentation
◆ checkEngine()
|
privateinherited |
check an individual engine
Definition at line 29 of file EventLoop.cc.
References AsyncEngine::checkEvents(), debugs, EventLoop::error, AsyncEngine::EVENT_ERROR, AsyncEngine::EVENT_IDLE, fatal_dump(), EventLoop::loop_delay, and EventLoop::runOnceResult.
Referenced by EventLoop::runOnce().
◆ 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()
|
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()
|
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()
|
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()
|
inherited |
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, EventLoop::last_loop, EventLoop::loop_delay, EventLoop::primaryEngine, EventLoop::runOnceResult, Time::Engine::tick(), and EventLoop::timeService.
Referenced by EventLoop::run(), TestEventLoop::testEngineErrors(), TestEventLoop::testEngineTimeout(), TestEventLoop::testRunOnce(), TestEventLoop::testSetPrimaryEngine(), TestEventLoop::testSetTimeService(), and TestUfs::testUfsSearch().
◆ setPrimaryEngine()
|
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()
|
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()
|
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
|
privateinherited |
Definition at line 87 of file EventLoop.h.
Referenced by EventLoop::registerEngine(), EventLoop::runOnce(), and EventLoop::setPrimaryEngine().
◆ errcount
|
inherited |
Definition at line 69 of file EventLoop.h.
Referenced by EventLoop::prepareToRun(), EventLoop::runOnce(), SquidMain(), and TestEventLoop::testEngineErrors().
◆ 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
|
privateinherited |
Definition at line 85 of file EventLoop.h.
Referenced by EventLoop::prepareToRun(), EventLoop::runOnce(), and EventLoop::stop().
◆ 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
|
privateinherited |
Definition at line 89 of file EventLoop.h.
Referenced by EventLoop::runOnce(), and EventLoop::setPrimaryEngine().
◆ Running
|
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
|
privateinherited |
the result from runOnce
Definition at line 92 of file EventLoop.h.
Referenced by EventLoop::checkEngine(), and EventLoop::runOnce().
◆ 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:
- src/tests/testStoreSupport.h
- src/tests/testStoreSupport.cc