AsyncCallQueue.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_ASYNCCALLQUEUE_H
10 #define SQUID_ASYNCCALLQUEUE_H
11 
12 #include "base/AsyncCallList.h"
13 #include "base/forward.h"
14 
15 // The queue of asynchronous calls. All calls are fired during a single main
16 // loop iteration until the queue is exhausted
18 {
19 public:
20  // there is only one queue
21  static AsyncCallQueue &Instance();
22 
23  // make this async call when we get a chance
24  void schedule(const AsyncCallPointer &call) { scheduled.add(call); }
25 
26  // fire all scheduled calls; returns true if at least one was fired
27  bool fire();
28 
29 private:
30  AsyncCallQueue() = default;
31 
33 
35 };
36 
37 #endif /* SQUID_ASYNCCALLQUEUE_H */
38 
static AsyncCallQueue & Instance()
void schedule(const AsyncCallPointer &call)
AsyncCallList scheduled
calls waiting to be fire()d, in FIFO order
static AsyncCallQueue * TheInstance
AsyncCallQueue()=default
void add(const AsyncCallPointer &)
stores the given async call

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors