ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
|
#include <reactor.h>
Public Member Functions | |
asynchronous_handler_wrapper (zmq::context_t &context, zmq::socket_t &async_handler_socket, reactor &reactor_ref, std::shared_ptr< handler_interface > handler) | |
~asynchronous_handler_wrapper () | |
virtual void | operator() (const message_container &message) |
![]() | |
handler_wrapper (reactor &reactor_ref, std::shared_ptr< handler_interface > handler) | |
virtual | ~handler_wrapper () |
Additional Inherited Members | |
![]() | |
std::shared_ptr< handler_interface > | handler_ |
reactor & | reactor_ |
A wrapper for reactor event handlers which calls the handler asynchronously, using ZeroMQ inprocess sockets. The handler itself runs in its own (exactly one) thread.
asynchronous_handler_wrapper::asynchronous_handler_wrapper | ( | zmq::context_t & | context, |
zmq::socket_t & | async_handler_socket, | ||
reactor & | reactor_ref, | ||
std::shared_ptr< handler_interface > | handler | ||
) |
context | ZeroMQ context used to communicate with the reactor |
async_handler_socket | The socket used to communicate with our worker thread (the reactor side) |
reactor_ref | The reactor whcih owns the handler |
handler | The handler object |
Definition at line 153 of file reactor.cpp.
asynchronous_handler_wrapper::~asynchronous_handler_wrapper | ( | ) |
Destroy the handler by sending a termination message to the worker thread. The ZeroMQ connection must still work for this to function.
Definition at line 163 of file reactor.cpp.
|
virtual |
Pass a message to the handler asynchronously. The message is copied when being sent through the inprocess socket.
message | The message to be passed |
Reimplemented from handler_wrapper.
Definition at line 173 of file reactor.cpp.