annotate OrthancStone/Sources/Loaders/OracleScheduler.h @ 2129:169e2e586ef7 StoneWebViewer-2.2

closing StoneWebViewer-2.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 17:08:21 +0200
parents 9ac2a65d4172
children 3889ae96d2e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1739
9ac2a65d4172 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
8 * modify it under the terms of the GNU Lesser General Public License
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
16 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * <http://www.gnu.org/licenses/>.
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1271
diff changeset
25 #include "../OrthancStone.h"
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1271
diff changeset
26
1228
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #if !defined(ORTHANC_ENABLE_DCMTK)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 # error The macro ORTHANC_ENABLE_DCMTK must be defined
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include "../Messages/IMessageEmitter.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include "../Messages/ObserverBase.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include "../Oracle/GetOrthancImageCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../Oracle/GetOrthancWebViewerJpegCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "../Oracle/HttpCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include "../Oracle/IOracle.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "../Oracle/OracleCommandExceptionMessage.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "../Oracle/OrthancRestApiCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 #include "../Oracle/ReadFileCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 # include "../Oracle/ParseDicomSuccessMessage.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 namespace OrthancStone
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 class OracleScheduler : public ObserverBase<OracleScheduler>
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 public:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 static const int PRIORITY_HIGH = -1;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 static const int PRIORITY_LOW = 100;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 private:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 enum Priority
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 Priority_Low,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 Priority_Standard,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 Priority_High
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 class ReceiverPayload;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 class ScheduledCommand;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 typedef std::multimap<int, ScheduledCommand*> Queue;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 IOracle& oracle_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 IMessageEmitter& emitter_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 Queue standardPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 Queue highPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 Queue lowPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 unsigned int maxHighPriorityCommands_; // Used if priority <= PRIORITY_HIGH
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 unsigned int maxStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 unsigned int maxLowPriorityCommands_; // Used if priority >= PRIORITY_LOW
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 unsigned int activeHighPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 unsigned int activeStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 unsigned int activeLowPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 uint64_t totalScheduled_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 uint64_t totalProcessed_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 void ClearQueue(Queue& queue);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 void RemoveReceiverFromQueue(Queue& queue,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 boost::shared_ptr<IObserver> receiver);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 void CheckInvariants() const;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 void SpawnFromQueue(Queue& queue,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 Priority priority);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 void SpawnCommands();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 void RemoveActiveCommand(const ReceiverPayload& payload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 void Handle(const GetOrthancImageCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 void Handle(const GetOrthancWebViewerJpegCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 void Handle(const HttpCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 void Handle(const OrthancRestApiCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 void Handle(const ParseDicomSuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 void Handle(const ReadFileCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 void Handle(const OracleCommandExceptionMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 OracleScheduler(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 IMessageEmitter& emitter,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 unsigned int maxHighPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 unsigned int maxStandardPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 unsigned int maxLowPriority);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 public:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 static boost::shared_ptr<OracleScheduler> Create(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 IObservable& oracleObservable,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 IMessageEmitter& emitter)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 return Create(oracle, oracleObservable, emitter, 1, 4, 1);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 static boost::shared_ptr<OracleScheduler> Create(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 IObservable& oracleObservable,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 IMessageEmitter& emitter,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 unsigned int maxHighPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 unsigned int maxStandardPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 unsigned int maxLowPriority);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 ~OracleScheduler();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 unsigned int GetMaxHighPriorityCommands() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 return maxHighPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 unsigned int GetMaxStandardPriorityCommands() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 return maxStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 unsigned int GetMaxLowPriorityCommands() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 return maxLowPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 uint64_t GetTotalScheduled() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 return totalScheduled_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 uint64_t GetTotalProcessed() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 return totalProcessed_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 }
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 // Cancel the HTTP requests that are still pending in the queues,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 // and that are associated with the given receiver. Note that the
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 // receiver might still receive answers to HTTP requests that were
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 // already submitted to the oracle.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 void CancelRequests(boost::shared_ptr<IObserver> receiver);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 void CancelAllRequests();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 void Schedule(boost::shared_ptr<IObserver> receiver,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 IOracleCommand* command /* Takes ownership */);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }