]> git.ipfire.org Git - thirdparty/squid.git/blame - src/base/AsyncCallQueue.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / base / AsyncCallQueue.h
CommitLineData
bbc27441 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
bbc27441
AJ
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
cfa20cf5 9#ifndef SQUID_ASYNCCALLQUEUE_H
10#define SQUID_ASYNCCALLQUEUE_H
11
882255af 12#include "base/AsyncCall.h"
cfa20cf5 13
14//class AsyncCall;
15
16// The queue of asynchronous calls. All calls are fired during a single main
17// loop iteration until the queue is exhausted
18class AsyncCallQueue
19{
20public:
21 // there is only one queue
26ac0430 22 static AsyncCallQueue &Instance();
cfa20cf5 23
24 // make this async call when we get a chance
26ac0430 25 void schedule(AsyncCall::Pointer &call);
cfa20cf5 26
27 // fire all scheduled calls; returns true if at least one was fired
28 bool fire();
29
30private:
31 AsyncCallQueue();
32
33 void fireNext();
34
35 AsyncCall::Pointer theHead;
36 AsyncCall::Pointer theTail;
37
38 static AsyncCallQueue *TheInstance;
39};
40
41#endif /* SQUID_ASYNCCALLQUEUE_H */
f53969cc 42