]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Strand.h
Enable source-formatting tools to collapse multiple whitelines in the source to one.
[thirdparty/squid.git] / src / ipc / Strand.h
1 /*
2 * $Id$
3 *
4 * DEBUG: section 54 Interprocess Communication
5 *
6 */
7
8 #ifndef SQUID_IPC_STRAND_H
9 #define SQUID_IPC_STRAND_H
10
11 #include "ipc/forward.h"
12 #include "ipc/Port.h"
13 #include "mgr/forward.h"
14 #if SQUID_SNMP
15 #include "snmp/forward.h"
16 #endif
17
18 namespace Ipc
19 {
20
21 class StrandCoord;
22
23 /// Receives coordination messages on behalf of its process or thread
24 class Strand: public Port
25 {
26 public:
27 Strand();
28
29 virtual void start(); // Port (AsyncJob) API
30
31 protected:
32 virtual void timedout(); // Port (UsdOp) API
33 virtual void receive(const TypedMsgHdr &message); // Port API
34
35 private:
36 void registerSelf(); /// let Coordinator know this strand exists
37 void handleRegistrationResponse(const HereIamMessage &msg);
38 void handleCacheMgrRequest(const Mgr::Request& request);
39 void handleCacheMgrResponse(const Mgr::Response& response);
40 #if SQUID_SNMP
41 void handleSnmpRequest(const Snmp::Request& request);
42 void handleSnmpResponse(const Snmp::Response& response);
43 #endif
44
45 private:
46 bool isRegistered; ///< whether Coordinator ACKed registration (unused)
47
48 private:
49 Strand(const Strand&); // not implemented
50 Strand& operator =(const Strand&); // not implemented
51
52 CBDATA_CLASS2(Strand);
53 };
54
55
56 }
57
58
59 #endif /* SQUID_IPC_STRAND_H */