comparison Core/JobsEngine/JobsRegistry.h @ 2570:2e879c796ec7 jobs

JobsRegistry::SubmitAndWait(), StoreScuJob
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 May 2018 21:42:04 +0200
parents 2af17cd5eb1f
children 3372c5255333
comparison
equal deleted inserted replaced
2569:2af17cd5eb1f 2570:2e879c796ec7
75 PendingJobs pendingJobs_; 75 PendingJobs pendingJobs_;
76 CompletedJobs completedJobs_; 76 CompletedJobs completedJobs_;
77 RetryJobs retryJobs_; 77 RetryJobs retryJobs_;
78 78
79 boost::condition_variable pendingJobAvailable_; 79 boost::condition_variable pendingJobAvailable_;
80 boost::condition_variable someJobComplete_;
80 size_t maxCompletedJobs_; 81 size_t maxCompletedJobs_;
81 82
82 83
83 #ifndef NDEBUG 84 #ifndef NDEBUG
84 bool IsPendingJob(const JobHandler& job) const; 85 bool IsPendingJob(const JobHandler& job) const;
97 98
98 void MarkRunningAsRetry(JobHandler& job, 99 void MarkRunningAsRetry(JobHandler& job,
99 unsigned int timeout); 100 unsigned int timeout);
100 101
101 void MarkRunningAsPaused(JobHandler& job); 102 void MarkRunningAsPaused(JobHandler& job);
103
104 bool GetStateInternal(JobState& state,
105 const std::string& id);
102 106
103 public: 107 public:
104 JobsRegistry() : 108 JobsRegistry() :
105 maxCompletedJobs_(10) 109 maxCompletedJobs_(10)
106 { 110 {
120 IJob* job, // Takes ownership 124 IJob* job, // Takes ownership
121 int priority); 125 int priority);
122 126
123 void Submit(IJob* job, // Takes ownership 127 void Submit(IJob* job, // Takes ownership
124 int priority); 128 int priority);
129
130 bool SubmitAndWait(IJob* job, // Takes ownership
131 int priority);
125 132
126 void SetPriority(const std::string& id, 133 void SetPriority(const std::string& id,
127 int priority); 134 int priority);
128 135
129 void Pause(const std::string& id); 136 void Pause(const std::string& id);