]>
Commit | Line | Data |
---|---|---|
cfa20cf5 | 1 | |
2 | /* | |
262a0e14 | 3 | * $Id$ |
cfa20cf5 | 4 | * |
5 | */ | |
6 | ||
7 | #ifndef SQUID_ASYNCCALLQUEUE_H | |
8 | #define SQUID_ASYNCCALLQUEUE_H | |
9 | ||
10 | #include "squid.h" | |
11 | #include "AsyncCall.h" | |
12 | ||
13 | //class AsyncCall; | |
14 | ||
15 | // The queue of asynchronous calls. All calls are fired during a single main | |
16 | // loop iteration until the queue is exhausted | |
17 | class AsyncCallQueue | |
18 | { | |
19 | public: | |
20 | // there is only one queue | |
26ac0430 | 21 | static AsyncCallQueue &Instance(); |
cfa20cf5 | 22 | |
23 | // make this async call when we get a chance | |
26ac0430 | 24 | void schedule(AsyncCall::Pointer &call); |
cfa20cf5 | 25 | |
26 | // fire all scheduled calls; returns true if at least one was fired | |
27 | bool fire(); | |
28 | ||
29 | private: | |
30 | AsyncCallQueue(); | |
31 | ||
32 | void fireNext(); | |
33 | ||
34 | AsyncCall::Pointer theHead; | |
35 | AsyncCall::Pointer theTail; | |
36 | ||
37 | static AsyncCallQueue *TheInstance; | |
38 | }; | |
39 | ||
40 | #endif /* SQUID_ASYNCCALLQUEUE_H */ |