]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/CollapsedForwarding.h
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 17 Request Forwarding */
11 #ifndef SQUID_SRC_COLLAPSEDFORWARDING_H
12 #define SQUID_SRC_COLLAPSEDFORWARDING_H
14 #include "ipc/forward.h"
15 #include "ipc/Queue.h"
16 #include "store/forward.h"
22 /// Sends and handles collapsed forwarding notifications.
23 class CollapsedForwarding
26 /// open shared memory segment
29 /// notify other workers about changes in entry state (e.g., new data)
30 static void Broadcast(const StoreEntry
&e
, const bool includingThisWorker
= false);
32 /// notify other workers about state changes in Transient entry at the given xitTable.index
33 /// use Broadcast(StoreEntry) variant if you have a StoreEntry object
34 static void Broadcast(const sfileno index
, const bool includingThisWorker
);
36 /// kick worker with empty IPC queue
37 static void Notify(const int workerId
);
39 /// handle new data messages in IPC queue
40 static void HandleNewData(const char *const when
);
42 /// handle queue push notifications from worker or disker
43 static void HandleNotification(const Ipc::TypedMsgHdr
&msg
);
45 /// prints IPC message queue state; suitable for cache manager reports
46 static void StatQueue(std::ostream
&);
49 static void HandleNewDataAtStart();
51 typedef Ipc::MultiQueue Queue
;
52 static std::unique_ptr
<Queue
> queue
; ///< IPC queue
55 #endif /* SQUID_SRC_COLLAPSEDFORWARDING_H */