Mercurial > hg > orthanc
annotate OrthancFramework/Sources/JobsEngine/JobsRegistry.h @ 4181:b416b6bf129b
clarification of sdk doc about deadlocks
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 08 Sep 2020 09:16:33 +0200 |
parents | bf7b9edf6b81 |
children | 2007ab69ac16 |
rev | line source |
---|---|
2569 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3240
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
2569 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
10 * the License, or (at your option) any later version. |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
11 * |
2569 | 12 * This program is distributed in the hope that it will be useful, but |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
15 * Lesser General Public License for more details. |
2569 | 16 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
18 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
2569 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #if !defined(ORTHANC_SANDBOXED) | |
26 # error The macro ORTHANC_SANDBOXED must be defined | |
27 #endif | |
28 | |
29 #if ORTHANC_SANDBOXED == 1 | |
30 # error The job engine cannot be used in sandboxed environments | |
31 #endif | |
32 | |
33 #include "JobInfo.h" | |
2648
e1893d31652a
serialization of JobHandler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2581
diff
changeset
|
34 #include "IJobUnserializer.h" |
2569 | 35 |
36 #include <list> | |
37 #include <set> | |
38 #include <queue> | |
39 #include <boost/thread/mutex.hpp> | |
40 #include <boost/thread/condition_variable.hpp> | |
41 | |
42 namespace Orthanc | |
43 { | |
44 // This class handles the state machine of the jobs engine | |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
45 class ORTHANC_PUBLIC JobsRegistry : public boost::noncopyable |
2569 | 46 { |
2673
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
47 public: |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
48 class ORTHANC_PUBLIC IObserver : public boost::noncopyable |
2673
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
49 { |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
50 public: |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
51 virtual ~IObserver() |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
52 { |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
53 } |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
54 |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
55 virtual void SignalJobSubmitted(const std::string& jobId) = 0; |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
56 |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
57 virtual void SignalJobSuccess(const std::string& jobId) = 0; |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
58 |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
59 virtual void SignalJobFailure(const std::string& jobId) = 0; |
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
60 }; |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
61 |
2569 | 62 private: |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
63 enum CompletedReason |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
64 { |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
65 CompletedReason_Success, |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
66 CompletedReason_Failure, |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
67 CompletedReason_Canceled |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
68 }; |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
69 |
2569 | 70 class JobHandler; |
71 | |
72 struct PriorityComparator | |
73 { | |
74 bool operator() (JobHandler*& a, | |
75 JobHandler*& b) const; | |
76 }; | |
77 | |
78 typedef std::map<std::string, JobHandler*> JobsIndex; | |
79 typedef std::list<JobHandler*> CompletedJobs; | |
80 typedef std::set<JobHandler*> RetryJobs; | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
81 typedef std::priority_queue<JobHandler*, |
2569 | 82 std::vector<JobHandler*>, // Could be a "std::deque" |
83 PriorityComparator> PendingJobs; | |
84 | |
85 boost::mutex mutex_; | |
86 JobsIndex jobsIndex_; | |
87 PendingJobs pendingJobs_; | |
88 CompletedJobs completedJobs_; | |
89 RetryJobs retryJobs_; | |
90 | |
91 boost::condition_variable pendingJobAvailable_; | |
2570
2e879c796ec7
JobsRegistry::SubmitAndWait(), StoreScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
92 boost::condition_variable someJobComplete_; |
2569 | 93 size_t maxCompletedJobs_; |
94 | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
95 IObserver* observer_; |
2673
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
96 |
2569 | 97 |
98 #ifndef NDEBUG | |
99 bool IsPendingJob(const JobHandler& job) const; | |
100 | |
101 bool IsCompletedJob(JobHandler& job) const; | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
102 |
2569 | 103 bool IsRetryJob(JobHandler& job) const; |
104 #endif | |
105 | |
106 void CheckInvariants() const; | |
107 | |
108 void ForgetOldCompletedJobs(); | |
109 | |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
110 void SetCompletedJob(JobHandler& job, |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
111 bool success); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
112 |
2569 | 113 void MarkRunningAsCompleted(JobHandler& job, |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
114 CompletedReason reason); |
2569 | 115 |
116 void MarkRunningAsRetry(JobHandler& job, | |
117 unsigned int timeout); | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
118 |
2569 | 119 void MarkRunningAsPaused(JobHandler& job); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
120 |
2570
2e879c796ec7
JobsRegistry::SubmitAndWait(), StoreScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
121 bool GetStateInternal(JobState& state, |
2e879c796ec7
JobsRegistry::SubmitAndWait(), StoreScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
122 const std::string& id); |
2569 | 123 |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
124 void RemovePendingJob(const std::string& id); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
125 |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
126 void RemoveRetryJob(JobHandler* handler); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
127 |
2667
5fa2f2ce74f0
serialization of JobsRegistry
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2648
diff
changeset
|
128 void SubmitInternal(std::string& id, |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
129 JobHandler* handler); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
130 |
2569 | 131 public: |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
132 JobsRegistry(size_t maxCompletedJobs) : |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
133 maxCompletedJobs_(maxCompletedJobs), |
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
134 observer_(NULL) |
2569 | 135 { |
136 } | |
137 | |
2667
5fa2f2ce74f0
serialization of JobsRegistry
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2648
diff
changeset
|
138 JobsRegistry(IJobUnserializer& unserializer, |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
139 const Json::Value& s, |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
140 size_t maxCompletedJobs); |
2569 | 141 |
142 ~JobsRegistry(); | |
143 | |
144 void SetMaxCompletedJobs(size_t i); | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
145 |
2950
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
146 size_t GetMaxCompletedJobs(); |
dc18d5804746
support of JobsHistorySize set to zero
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
147 |
2569 | 148 void ListJobs(std::set<std::string>& target); |
149 | |
150 bool GetJobInfo(JobInfo& target, | |
151 const std::string& id); | |
2648
e1893d31652a
serialization of JobHandler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2581
diff
changeset
|
152 |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2950
diff
changeset
|
153 bool GetJobOutput(std::string& output, |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2950
diff
changeset
|
154 MimeType& mime, |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2950
diff
changeset
|
155 const std::string& job, |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2950
diff
changeset
|
156 const std::string& key); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2950
diff
changeset
|
157 |
2648
e1893d31652a
serialization of JobHandler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2581
diff
changeset
|
158 void Serialize(Json::Value& target); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
159 |
2569 | 160 void Submit(std::string& id, |
161 IJob* job, // Takes ownership | |
162 int priority); | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
163 |
2569 | 164 void Submit(IJob* job, // Takes ownership |
165 int priority); | |
2570
2e879c796ec7
JobsRegistry::SubmitAndWait(), StoreScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
166 |
3240
e44e0127e553
Fix issue #134 (/patient/modify gives 500, should really be 400)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3179
diff
changeset
|
167 void SubmitAndWait(Json::Value& successContent, |
2867 | 168 IJob* job, // Takes ownership |
2570
2e879c796ec7
JobsRegistry::SubmitAndWait(), StoreScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
169 int priority); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
170 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2570
diff
changeset
|
171 bool SetPriority(const std::string& id, |
2569 | 172 int priority); |
173 | |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2570
diff
changeset
|
174 bool Pause(const std::string& id); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
175 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2570
diff
changeset
|
176 bool Resume(const std::string& id); |
2569 | 177 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2570
diff
changeset
|
178 bool Resubmit(const std::string& id); |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
179 |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
180 bool Cancel(const std::string& id); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
181 |
2569 | 182 void ScheduleRetries(); |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
183 |
2569 | 184 bool GetState(JobState& state, |
185 const std::string& id); | |
186 | |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
187 void SetObserver(IObserver& observer); |
2673
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
188 |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
189 void ResetObserver(); |
2673
8e0bc055d18c
JobsRegistry::IObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2669
diff
changeset
|
190 |
3177
053e72ff9fc5
new metrics: orthanc_jobs_[pending|running|completed]
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
191 void GetStatistics(unsigned int& pending, |
053e72ff9fc5
new metrics: orthanc_jobs_[pending|running|completed]
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
192 unsigned int& running, |
3179
fca730c267d7
New primitives to set and refresh metrics
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3177
diff
changeset
|
193 unsigned int& success, |
fca730c267d7
New primitives to set and refresh metrics
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3177
diff
changeset
|
194 unsigned int& errors); |
3177
053e72ff9fc5
new metrics: orthanc_jobs_[pending|running|completed]
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
195 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
196 class ORTHANC_PUBLIC RunningJob : public boost::noncopyable |
2569 | 197 { |
198 private: | |
199 JobsRegistry& registry_; | |
200 JobHandler* handler_; // Can only be accessed if the | |
201 // registry mutex is locked! | |
202 IJob* job_; // Will by design be in mutual exclusion, | |
203 // because only one RunningJob can be | |
204 // executed at a time on a JobHandler | |
205 | |
206 std::string id_; | |
207 int priority_; | |
208 JobState targetState_; | |
209 unsigned int targetRetryTimeout_; | |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
210 bool canceled_; |
4024
1d2b31fc782f
new 'changes': JobSubmitted, JobSuccess, JobFailure
Alain Mazy <alain@mazy.be>
parents:
4022
diff
changeset
|
211 |
2569 | 212 public: |
213 RunningJob(JobsRegistry& registry, | |
214 unsigned int timeout); | |
215 | |
216 ~RunningJob(); | |
217 | |
218 bool IsValid() const; | |
219 | |
220 const std::string& GetId() const; | |
221 | |
222 int GetPriority() const; | |
223 | |
224 IJob& GetJob(); | |
225 | |
226 bool IsPauseScheduled(); | |
227 | |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
228 bool IsCancelScheduled(); |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
229 |
2569 | 230 void MarkSuccess(); |
231 | |
232 void MarkFailure(); | |
233 | |
234 void MarkPause(); | |
235 | |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
236 void MarkCanceled(); |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
237 |
2569 | 238 void MarkRetry(unsigned int timeout); |
239 | |
3240
e44e0127e553
Fix issue #134 (/patient/modify gives 500, should really be 400)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3179
diff
changeset
|
240 void UpdateStatus(ErrorCode code, |
e44e0127e553
Fix issue #134 (/patient/modify gives 500, should really be 400)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3179
diff
changeset
|
241 const std::string& details); |
2569 | 242 }; |
243 }; | |
244 } |