]> git.ipfire.org Git - thirdparty/squid.git/blame - src/CollapsedForwarding.h
CI: Remove unnecessary test-functionality test wrappers (#1393)
[thirdparty/squid.git] / src / CollapsedForwarding.h
CommitLineData
807feb1d 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
807feb1d 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.
807feb1d
DK
7 */
8
bbc27441
AJ
9/* DEBUG: section 17 Request Forwarding */
10
807feb1d
DK
11#ifndef SQUID_COLLAPSED_FORWARDING_H
12#define SQUID_COLLAPSED_FORWARDING_H
13
807feb1d 14#include "ipc/forward.h"
9d4e9cfb 15#include "ipc/Queue.h"
4310f8b0 16#include "store/forward.h"
807feb1d
DK
17
18#include <memory>
19
99921d9d 20class StoreEntry;
807feb1d
DK
21
22/// Sends and handles collapsed forwarding notifications.
23class CollapsedForwarding
24{
25public:
26 /// open shared memory segment
27 static void Init();
28
4475555f 29 /// notify other workers about changes in entry state (e.g., new data)
4310f8b0
EB
30 static void Broadcast(const StoreEntry &e, const bool includingThisWorker = false);
31
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);
ce49546e 35
807feb1d
DK
36 /// kick worker with empty IPC queue
37 static void Notify(const int workerId);
38
39 /// handle new data messages in IPC queue
40 static void HandleNewData(const char *const when);
41
42 /// handle queue push notifications from worker or disker
43 static void HandleNotification(const Ipc::TypedMsgHdr &msg);
44
d8ee9e8d
EB
45 /// prints IPC message queue state; suitable for cache manager reports
46 static void StatQueue(std::ostream &);
47
807feb1d 48private:
5faec1a1
EB
49 static void HandleNewDataAtStart();
50
807feb1d 51 typedef Ipc::MultiQueue Queue;
829030b5 52 static std::unique_ptr<Queue> queue; ///< IPC queue
807feb1d
DK
53};
54
55#endif /* SQUID_COLLAPSED_FORWARDING_H */
f53969cc 56