]>
Commit | Line | Data |
---|---|---|
10cefb7b | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
10cefb7b | 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. | |
10cefb7b | 7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 54 Interprocess Communication */ |
10 | ||
10cefb7b | 11 | #ifndef SQUID_IPC_STRAND_H |
12 | #define SQUID_IPC_STRAND_H | |
13 | ||
254912f3 | 14 | #include "ipc/forward.h" |
10cefb7b | 15 | #include "ipc/Port.h" |
8822ebee | 16 | #include "mgr/forward.h" |
f738d783 | 17 | #if SQUID_SNMP |
d6e3ad20 | 18 | #include "snmp/forward.h" |
f738d783 | 19 | #endif |
10cefb7b | 20 | |
21 | namespace Ipc | |
22 | { | |
23 | ||
1bac0258 | 24 | class StrandCoord; |
10cefb7b | 25 | |
ba568924 AR |
26 | /// Receives coordination messages on behalf of its process or thread |
27 | class Strand: public Port | |
10cefb7b | 28 | { |
337b9aa4 | 29 | CBDATA_CHILD(Strand); |
5c2f68b7 | 30 | |
10cefb7b | 31 | public: |
32 | Strand(); | |
33 | ||
337b9aa4 | 34 | void start() override; // Port (AsyncJob) API |
ba568924 AR |
35 | |
36 | protected: | |
337b9aa4 AR |
37 | void timedout() override; // Port (UsdOp) API |
38 | void receive(const TypedMsgHdr &message) override; // Port API | |
10cefb7b | 39 | |
40 | private: | |
ba568924 | 41 | void registerSelf(); /// let Coordinator know this strand exists |
6ccfd70a | 42 | void handleRegistrationResponse(const StrandMessage &); |
8822ebee AR |
43 | void handleCacheMgrRequest(const Mgr::Request& request); |
44 | void handleCacheMgrResponse(const Mgr::Response& response); | |
f738d783 | 45 | #if SQUID_SNMP |
51ea0904 CT |
46 | void handleSnmpRequest(const Snmp::Request& request); |
47 | void handleSnmpResponse(const Snmp::Response& response); | |
f738d783 | 48 | #endif |
10cefb7b | 49 | |
50 | private: | |
ba568924 | 51 | bool isRegistered; ///< whether Coordinator ACKed registration (unused) |
10cefb7b | 52 | |
ba568924 AR |
53 | private: |
54 | Strand(const Strand&); // not implemented | |
55 | Strand& operator =(const Strand&); // not implemented | |
10cefb7b | 56 | }; |
57 | ||
10cefb7b | 58 | } |
59 | ||
10cefb7b | 60 | #endif /* SQUID_IPC_STRAND_H */ |
f53969cc | 61 |