]> git.ipfire.org Git - thirdparty/squid.git/blob - src/CollapsedForwarding.h
Merged from trunk 13199.
[thirdparty/squid.git] / src / CollapsedForwarding.h
1 /*
2 * DEBUG: section 17 Request Forwarding
3 *
4 */
5
6 #ifndef SQUID_COLLAPSED_FORWARDING_H
7 #define SQUID_COLLAPSED_FORWARDING_H
8
9 #include "ipc/forward.h"
10 #include "ipc/Queue.h"
11 #include "typedefs.h"
12
13 #include <memory>
14
15 class StoreEntry;
16
17 /// Sends and handles collapsed forwarding notifications.
18 class CollapsedForwarding
19 {
20 public:
21 /// open shared memory segment
22 static void Init();
23
24 /// notify other workers about changes in entry state (e.g., new data)
25 static void Broadcast(const StoreEntry &e);
26
27 /// kick worker with empty IPC queue
28 static void Notify(const int workerId);
29
30 /// handle new data messages in IPC queue
31 static void HandleNewData(const char *const when);
32
33 /// handle queue push notifications from worker or disker
34 static void HandleNotification(const Ipc::TypedMsgHdr &msg);
35
36 private:
37 typedef Ipc::MultiQueue Queue;
38 static std::auto_ptr<Queue> queue; ///< IPC queue
39 };
40
41 #endif /* SQUID_COLLAPSED_FORWARDING_H */