]>
Commit | Line | Data |
---|---|---|
807feb1d | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
807feb1d | 3 | * |
bbc27441 AJ |
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. | |
807feb1d DK |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 17 Request Forwarding */ |
10 | ||
807feb1d DK |
11 | #ifndef SQUID_COLLAPSED_FORWARDING_H |
12 | #define SQUID_COLLAPSED_FORWARDING_H | |
13 | ||
807feb1d | 14 | #include "ipc/forward.h" |
9d4e9cfb | 15 | #include "ipc/Queue.h" |
ce49546e | 16 | #include "typedefs.h" |
807feb1d DK |
17 | |
18 | #include <memory> | |
19 | ||
99921d9d | 20 | class StoreEntry; |
807feb1d DK |
21 | |
22 | /// Sends and handles collapsed forwarding notifications. | |
23 | class CollapsedForwarding | |
24 | { | |
25 | public: | |
26 | /// open shared memory segment | |
27 | static void Init(); | |
28 | ||
4475555f | 29 | /// notify other workers about changes in entry state (e.g., new data) |
99921d9d | 30 | static void Broadcast(const StoreEntry &e); |
ce49546e | 31 | |
807feb1d DK |
32 | /// kick worker with empty IPC queue |
33 | static void Notify(const int workerId); | |
34 | ||
35 | /// handle new data messages in IPC queue | |
36 | static void HandleNewData(const char *const when); | |
37 | ||
38 | /// handle queue push notifications from worker or disker | |
39 | static void HandleNotification(const Ipc::TypedMsgHdr &msg); | |
40 | ||
41 | private: | |
42 | typedef Ipc::MultiQueue Queue; | |
43 | static std::auto_ptr<Queue> queue; ///< IPC queue | |
44 | }; | |
45 | ||
46 | #endif /* SQUID_COLLAPSED_FORWARDING_H */ | |
f53969cc | 47 |