ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
status_notifier_handler Class Reference

#include <status_notifier_handler.h>

+ Inheritance diagram for status_notifier_handler:

Public Member Functions

 status_notifier_handler (const notifier_config &config, std::shared_ptr< spdlog::logger > logger)
 
void on_request (const message_container &message, response_cb respond)
 

Static Public Attributes

static const std::string TYPE_ERROR = "error"
 
static const std::string TYPE_JOB_STATUS = "job-status"
 

Additional Inherited Members

- Public Types inherited from handler_interface
typedef std::function< void(const message_container &)> response_cb
 

Detailed Description

Receives status notifications from the reactor and forwards them to the frontend REST API

Definition at line 14 of file status_notifier_handler.h.

Constructor & Destructor Documentation

§ status_notifier_handler()

status_notifier_handler::status_notifier_handler ( const notifier_config config,
std::shared_ptr< spdlog::logger >  logger 
)
Parameters
configA notifier configuration (contains URL and credentials for the REST API)
loggerA logger used when a HTTP request fails

Definition at line 10 of file status_notifier_handler.cpp.

Member Function Documentation

§ on_request()

void status_notifier_handler::on_request ( const message_container message,
response_cb  response 
)
virtual

Process a message the handler is subscribed to

Parameters
messagemessage to be processed
responsecallback that enables the handler to respond

Implements handler_interface.

Definition at line 15 of file status_notifier_handler.cpp.

Member Data Documentation

§ TYPE_ERROR

const std::string status_notifier_handler::TYPE_ERROR = "error"
static

REST API endpoint that receives error messages

Definition at line 20 of file status_notifier_handler.h.

§ TYPE_JOB_STATUS

const std::string status_notifier_handler::TYPE_JOB_STATUS = "job-status"
static

REST API endpoint that receives job status messages

Definition at line 25 of file status_notifier_handler.h.


The documentation for this class was generated from the following files: