annotate Framework/Loaders/OracleScheduler.h @ 1313:f30905f5d246 broker

Added support for OnGenericSdlEvent to GuiAdapter. This makes it possible to piggyback app-specific logic to special events (here, to support the Viewport refresh events)
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 16 Mar 2020 11:12:39 +0100
parents 0ca50d275b9a
children 28c64c246312
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
1271
0ca50d275b9a upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1228
diff changeset
5 * Copyright (C) 2017-2020 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
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
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
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
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 #pragma once
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #if !defined(ORTHANC_ENABLE_DCMTK)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 # 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
26 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include "../Messages/IMessageEmitter.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include "../Messages/ObserverBase.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include "../Oracle/GetOrthancImageCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include "../Oracle/GetOrthancWebViewerJpegCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include "../Oracle/HttpCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include "../Oracle/IOracle.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../Oracle/OracleCommandExceptionMessage.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "../Oracle/OrthancRestApiCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include "../Oracle/ReadFileCommand.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 # include "../Oracle/ParseDicomSuccessMessage.h"
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 namespace OrthancStone
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 class OracleScheduler : public ObserverBase<OracleScheduler>
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 public:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 static const int PRIORITY_HIGH = -1;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 static const int PRIORITY_LOW = 100;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 private:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 enum Priority
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 Priority_Low,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 Priority_Standard,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 Priority_High
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 class ReceiverPayload;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 class ScheduledCommand;
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 typedef std::multimap<int, ScheduledCommand*> Queue;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 IOracle& oracle_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 IMessageEmitter& emitter_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 Queue standardPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 Queue highPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 Queue lowPriorityQueue_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 unsigned int maxHighPriorityCommands_; // Used if priority <= PRIORITY_HIGH
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 unsigned int maxStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 unsigned int maxLowPriorityCommands_; // Used if priority >= PRIORITY_LOW
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 unsigned int activeHighPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 unsigned int activeStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 unsigned int activeLowPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 uint64_t totalScheduled_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 uint64_t totalProcessed_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 void ClearQueue(Queue& queue);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 void RemoveReceiverFromQueue(Queue& queue,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 boost::shared_ptr<IObserver> receiver);
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 CheckInvariants() const;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 void SpawnFromQueue(Queue& queue,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 Priority priority);
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 SpawnCommands();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 void RemoveActiveCommand(const ReceiverPayload& payload);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 void Handle(const GetOrthancImageCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 void Handle(const GetOrthancWebViewerJpegCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 void Handle(const HttpCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 void Handle(const OrthancRestApiCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 #if ORTHANC_ENABLE_DCMTK == 1
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 void Handle(const ParseDicomSuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 #endif
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 void Handle(const ReadFileCommand::SuccessMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 void Handle(const OracleCommandExceptionMessage& message);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 OracleScheduler(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 IMessageEmitter& emitter,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 unsigned int maxHighPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 unsigned int maxStandardPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 unsigned int maxLowPriority);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 public:
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 static boost::shared_ptr<OracleScheduler> Create(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 IObservable& oracleObservable,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 IMessageEmitter& emitter)
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 return Create(oracle, oracleObservable, emitter, 1, 4, 1);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 }
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 static boost::shared_ptr<OracleScheduler> Create(IOracle& oracle,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 IObservable& oracleObservable,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 IMessageEmitter& emitter,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 unsigned int maxHighPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 unsigned int maxStandardPriority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 unsigned int maxLowPriority);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 ~OracleScheduler();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 unsigned int GetMaxHighPriorityCommands() const
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 {
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 return maxHighPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }
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 unsigned int GetMaxStandardPriorityCommands() const
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 return maxStandardPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
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 unsigned int GetMaxLowPriorityCommands() const
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 return maxLowPriorityCommands_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 }
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 uint64_t GetTotalScheduled() const
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 return totalScheduled_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 }
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 uint64_t GetTotalProcessed() const
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 return totalProcessed_;
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
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 // 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
156 // 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
157 // 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
158 // already submitted to the oracle.
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 void CancelRequests(boost::shared_ptr<IObserver> receiver);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 void CancelAllRequests();
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 void Schedule(boost::shared_ptr<IObserver> receiver,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 int priority,
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 IOracleCommand* command /* Takes ownership */);
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 };
c471a0aa137b adding the next generation of loaders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 }