EventLoop.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_EVENTLOOP_H
10#define SQUID_EVENTLOOP_H
11
12#include "time/forward.h"
13
14#include <vector>
15
16#define EVENT_LOOP_TIMEOUT 1000 /* 1s timeout */
17
18class AsyncEngine;
19
27{
28
29public:
30 EventLoop();
31
35 void registerEngine(AsyncEngine *engine);
36
41 void run();
42
48 bool runOnce();
49
57 void setPrimaryEngine(AsyncEngine * engine);
58
63
67 void stop();
68
70
74
75private:
77 void prepareToRun();
78
80 void checkEngine(AsyncEngine * engine, bool const primary);
81
83 bool dispatchCalls();
84
86 typedef std::vector<AsyncEngine *> engine_vector;
91 bool error;
93};
94
95#endif /* SQUID_EVENTLOOP_H */
96
bool last_loop
Definition: EventLoop.h:85
void prepareToRun()
Definition: EventLoop.cc:63
int loop_delay
Definition: EventLoop.h:90
void checkEngine(AsyncEngine *engine, bool const primary)
Definition: EventLoop.cc:29
Time::Engine * timeService
Definition: EventLoop.h:88
int errcount
Definition: EventLoop.h:69
void run()
Definition: EventLoop.cc:76
static EventLoop * Running
Definition: EventLoop.h:73
bool runOnceResult
Definition: EventLoop.h:92
engine_vector engines
Definition: EventLoop.h:87
AsyncEngine * primaryEngine
Definition: EventLoop.h:89
void setTimeService(Time::Engine *)
Definition: EventLoop.cc:162
void registerEngine(AsyncEngine *engine)
Definition: EventLoop.cc:70
bool dispatchCalls()
Definition: EventLoop.cc:142
std::vector< AsyncEngine * > engine_vector
Definition: EventLoop.h:86
void stop()
Definition: EventLoop.cc:168
void setPrimaryEngine(AsyncEngine *engine)
Definition: EventLoop.cc:149
bool error
Definition: EventLoop.h:91
bool runOnce()
Definition: EventLoop.cc:89
event class for doing synthetic time etc
Definition: Engine.h:16

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors