]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Strand.h
merge from trunk
[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/Port.h"
12 #include "mgr/forward.h"
13 #if SQUID_SNMP
14 #include "snmp/forward.h"
15 #endif
16
17 namespace Ipc
18 {
19
20 class StrandCoord;
21
22 /// Receives coordination messages on behalf of its process or thread
23 class Strand: public Port
24 {
25 public:
26 Strand();
27
28 virtual void start(); // Port (AsyncJob) API
29
30 protected:
31 virtual void timedout(); // Port (UsdOp) API
32 virtual void receive(const TypedMsgHdr &message); // Port API
33
34 private:
35 void registerSelf(); /// let Coordinator know this strand exists
36 void handleRegistrationResponse(const StrandCoord &strand);
37 void handleCacheMgrRequest(const Mgr::Request& request);
38 void handleCacheMgrResponse(const Mgr::Response& response);
39 #if SQUID_SNMP
40 void handleSnmpRequest(const Snmp::Request& request);
41 void handleSnmpResponse(const Snmp::Response& response);
42 #endif
43
44 private:
45 bool isRegistered; ///< whether Coordinator ACKed registration (unused)
46
47 private:
48 Strand(const Strand&); // not implemented
49 Strand& operator =(const Strand&); // not implemented
50
51 CBDATA_CLASS2(Strand);
52 };
53
54
55 }
56
57
58 #endif /* SQUID_IPC_STRAND_H */