]>
Commit | Line | Data |
---|---|---|
10cefb7b | 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 | ||
10cefb7b | 11 | #include "ipc/Port.h" |
8822ebee | 12 | #include "mgr/forward.h" |
10cefb7b | 13 | |
14 | ||
15 | namespace Ipc | |
16 | { | |
17 | ||
1bac0258 | 18 | class StrandCoord; |
10cefb7b | 19 | |
ba568924 AR |
20 | /// Receives coordination messages on behalf of its process or thread |
21 | class Strand: public Port | |
10cefb7b | 22 | { |
10cefb7b | 23 | public: |
24 | Strand(); | |
25 | ||
ba568924 AR |
26 | virtual void start(); // Port (AsyncJob) API |
27 | ||
28 | protected: | |
29 | virtual void timedout(); // Port (UsdOp) API | |
1bac0258 | 30 | virtual void receive(const TypedMsgHdr &message); // Port API |
10cefb7b | 31 | |
32 | private: | |
ba568924 | 33 | void registerSelf(); /// let Coordinator know this strand exists |
1bac0258 | 34 | void handleRegistrationResponse(const StrandCoord &strand); |
8822ebee AR |
35 | void handleCacheMgrRequest(const Mgr::Request& request); |
36 | void handleCacheMgrResponse(const Mgr::Response& response); | |
10cefb7b | 37 | |
38 | private: | |
ba568924 | 39 | bool isRegistered; ///< whether Coordinator ACKed registration (unused) |
10cefb7b | 40 | |
ba568924 AR |
41 | private: |
42 | Strand(const Strand&); // not implemented | |
43 | Strand& operator =(const Strand&); // not implemented | |
4ea256cd AR |
44 | |
45 | CBDATA_CLASS2(Strand); | |
10cefb7b | 46 | }; |
47 | ||
48 | ||
49 | } | |
50 | ||
51 | ||
52 | #endif /* SQUID_IPC_STRAND_H */ |