ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
|
#include <http_status_notifier.h>
Public Member Functions | |
http_status_notifier (const notifier_config &config, std::shared_ptr< spdlog::logger > logger=nullptr) | |
virtual void | error (const std::string &desc) |
virtual void | rejected_job (const std::string &job_id, const std::string &desc="") |
virtual void | rejected_jobs (std::vector< std::string > job_ids, const std::string &desc="") |
virtual void | job_done (const std::string &job_id) |
virtual void | job_failed (const std::string &job_id, const std::string &desc="") |
A status notifier that uses HTTP (specifically the REST API) to notify the frontend of errors.
Definition at line 14 of file http_status_notifier.h.
http_status_notifier::http_status_notifier | ( | const notifier_config & | config, |
std::shared_ptr< spdlog::logger > | logger = nullptr |
||
) |
config | configuration of frontend connection |
logger | a logger object used when errors happen |
Definition at line 3 of file http_status_notifier.cpp.
|
virtual |
Basically tells frontend that there was some serious problem which has to be solved by administrator. Should be used only for generic errors which does not need any special treatment.
desc | description of error which was caused in broker |
Implements status_notifier_interface.
Definition at line 21 of file http_status_notifier.cpp.
|
virtual |
Notify that job with given id was successfully executed.
job_id | identification of job |
Implements status_notifier_interface.
Definition at line 38 of file http_status_notifier.cpp.
|
virtual |
Is called when worker return job results with status not equal to OK.
job_id | identification of failed job |
desc | description which come with results from worker |
Implements status_notifier_interface.
Definition at line 43 of file http_status_notifier.cpp.
|
virtual |
Nofity frontend that broker cannot assign one particular job.
job_id | identification of job |
desc | description why job was rejected |
Implements status_notifier_interface.
Definition at line 26 of file http_status_notifier.cpp.
|
virtual |
Notify frontend that broker had to throw away some jobs and they have to be execute again. This might happen for instance if worker dies and there is none with the same headers.
job_ids | list of job ids which was not executed |
desc | description why jobs were rejected |
Implements status_notifier_interface.
Definition at line 31 of file http_status_notifier.cpp.