11#ifndef SQUID_SRC_IPC_COORDINATOR_H
12#define SQUID_SRC_IPC_COORDINATOR_H
45 void start()
override;
74 typedef std::map<OpenListenerParams, Comm::ConnectionPointer>
Listeners;
Coordinates shared activities of Strands (Squid processes or threads)
StrandCoord * findStrand(int kidId)
registered strand or NULL
std::map< OpenListenerParams, Comm::ConnectionPointer > Listeners
params:connection map
void handleSharedListenRequest(const SharedListenRequest &request)
returns cached socket or calls openListenSocket()
Searchers searchers
yet unanswered search requests in arrival order
Listeners listeners
cached comm_open_listener() results
Comm::ConnectionPointer openListenSocket(const SharedListenRequest &request, int &errNo)
calls comm_open_listener()
std::list< StrandSearchRequest > Searchers
search requests
void receive(const TypedMsgHdr &message) override
Coordinator(const Coordinator &)
void handleSnmpRequest(const Snmp::Request &request)
Coordinator & operator=(const Coordinator &)
static Coordinator * TheInstance
the only class instance in existence
const StrandCoords & strands() const
currently registered strands
CBDATA_CHILD(Coordinator)
void handleCacheMgrRequest(const Mgr::Request &request)
void notifySearcher(const StrandSearchRequest &request, const StrandCoord &)
answer the waiting search request
void handleSnmpResponse(const Snmp::Response &response)
void start() override
called by AsyncStart; do not call directly
static Coordinator * Instance()
void registerStrand(const StrandCoord &)
adds or updates existing
void handleSearchRequest(const StrandSearchRequest &request)
answers or queues the request if the answer is not yet known
void handleCacheMgrResponse(const Mgr::Response &response)
void handleRegistrationRequest(const StrandMessage &)
register,ACK
StrandCoords strands_
registered processes and threads
void broadcastSignal(int sig) const
send sig to registered strands
Waits for and receives incoming IPC messages; kids handle the messages.
a request for a listen socket with given parameters
an IPC message carrying StrandCoord
asynchronous strand search request
struct msghdr with a known type, fixed-size I/O and control buffers
std::vector< StrandCoord > StrandCoords
a collection of strand coordinates; the order, if any, is owner-dependent