24 #ifndef LAUNCHER_PLUGINS_LOCAL_JOB_RUNNER_HPP
25 #define LAUNCHER_PLUGINS_LOCAL_JOB_RUNNER_HPP
29 #include <api/Job.hpp>
30 #include <api/Response.hpp>
31 #include <jobs/JobStatusNotifier.hpp>
33 #include <LocalSecureCookie.hpp>
36 namespace launcher_plugins {
42 class AsyncDeadlineEvent;
48 class LocalJobRepository;
55 namespace launcher_plugins {
72 const std::string& in_hostname,
73 jobs::JobStatusNotifierPtr in_notifier,
74 std::shared_ptr<LocalJobRepository> in_jobRepository);
91 Error runJob(api::JobPtr& io_job,
bool& out_wasInvalidJob);
95 typedef std::weak_ptr<LocalJobRunner> WeakLocalJobRunner;
96 typedef std::map<std::string, std::shared_ptr<system::AsyncDeadlineEvent> > ProcessWatchEvents;
98 static void onJobErrorCallback(api::JobPtr in_job,
const std::string& in_errorStr);
107 static void onJobExitCallback(WeakLocalJobRunner in_weakThis,
int in_exitCode, api::JobPtr io_job);
116 static void onProcessWatchDeadline(WeakLocalJobRunner in_weakThis,
int in_count, api::JobPtr io_job);
124 void addProcessWatchEvent(
125 const std::string& in_id,
126 const std::shared_ptr<system::AsyncDeadlineEvent>& in_processWatchEvent);
133 void removeWatchEvent(
const std::string& in_id);
136 const std::string& m_hostname;
139 std::shared_ptr<LocalJobRepository> m_jobRepo;
145 jobs::JobStatusNotifierPtr m_notifier;
148 ProcessWatchEvents m_processWatchEvents;