7 #ifndef PACKAGER_APP_JOB_MANAGER_H_
8 #define PACKAGER_APP_JOB_MANAGER_H_
13 #include "packager/base/threading/simple_thread.h"
14 #include "packager/status.h"
24 class Job :
public base::SimpleThread {
26 Job(
const std::string& name, std::shared_ptr<OriginHandler> work);
35 const Status& status()
const {
return status_; }
39 base::WaitableEvent* wait() {
return &wait_; }
43 Job& operator=(
const Job&) =
delete;
47 std::shared_ptr<OriginHandler> work_;
50 base::WaitableEvent wait_;
61 explicit JobManager(std::unique_ptr<SyncPointQueue> sync_points);
68 void Add(
const std::string& name, std::shared_ptr<OriginHandler> handler);
73 virtual Status InitializeJobs();
92 std::shared_ptr<OriginHandler> worker;
95 std::vector<JobEntry> job_entries_;
96 std::vector<std::unique_ptr<Job>> jobs_;
99 std::unique_ptr<SyncPointQueue> sync_points_;
105 #endif // PACKAGER_APP_JOB_MANAGER_H_