rad
2.0.0
|
#include <msgRequestor.hpp>
Public Types | |
using | request_t = TREQ |
using | reply_t = TREP |
using | handler_t = std::function< void(const std::error_code &, reply_t)> |
using | request_t = TREQ |
using | reply_t = TREP |
using | handler_t = std::function< void(const std::error_code &, reply_t)> |
Public Member Functions | |
MsgRequestor2 (const std::string &endpoint, const std::string &identity, boost::asio::io_service &ios) | |
virtual | ~MsgRequestor2 () |
MsgRequestor2 (const MsgRequestor2 &)=delete | |
MsgRequestor2 & | operator= (const MsgRequestor2 &)=delete |
MsgRequestor2 (MsgRequestor2 &&)=default | |
MsgRequestor2 & | operator= (MsgRequestor2 &&)=default |
size_t | AsyncSendReceive (const request_t &payload, handler_t handler, std::chrono::milliseconds const timeout=std::chrono::milliseconds(0)) |
MsgRequestor2 (const std::string &endpoint, const std::string &identity, boost::asio::io_service &ios) | |
virtual | ~MsgRequestor2 () |
MsgRequestor2 (const MsgRequestor2 &)=delete | |
MsgRequestor2 & | operator= (const MsgRequestor2 &)=delete |
MsgRequestor2 (MsgRequestor2 &&)=default | |
MsgRequestor2 & | operator= (MsgRequestor2 &&)=default |
size_t | AsyncSendReceive (const request_t &payload, handler_t handler, std::chrono::milliseconds const timeout=std::chrono::milliseconds(0)) |
This class allows to asynchronously send requests and wait for a reply.
TREQ | Request message type |
TREP | Response message type |
using rad::MsgRequestor2< TREQ, TREP >::handler_t = std::function<void(const std::error_code&, reply_t)> |
using rad::MsgRequestor2< TREQ, TREP >::handler_t = std::function<void(const std::error_code&, reply_t)> |
using rad::MsgRequestor2< TREQ, TREP >::reply_t = TREP |
using rad::MsgRequestor2< TREQ, TREP >::reply_t = TREP |
using rad::MsgRequestor2< TREQ, TREP >::request_t = TREQ |
using rad::MsgRequestor2< TREQ, TREP >::request_t = TREQ |
|
inline |
Constructor for MsgRequestor2 class.
[in] | endpoint | Destination address and port to be used to send the requests. |
[in] | identity | Prefix to be used to build the request identifier. |
[in] | ios | Reference to the event loop. |
On | connection error. |
|
inlinevirtual |
|
delete |
|
default |
|
inline |
Constructor for MsgRequestor2 class.
[in] | endpoint | Destination address and port to be used to send the requests. |
[in] | identity | Prefix to be used to build the request identifier. |
[in] | ios | Reference to the event loop. |
On | connection error. |
|
inlinevirtual |
|
delete |
|
default |
|
inline |
Asynchronosly send a request message to an destination process and schedule a handler to receive the reply.
[in] | payload | Request's payload. |
[in] | handler | Handler of the reply. Handler may not throw an exception! |
[in] | timeout | Timeout of request, set to zero for no timeout. |
|
inline |
Asynchronosly send a request message to an destination process and schedule a handler to receive the reply.
[in] | payload | Request's payload. |
[in] | handler | Handler of the reply. Handler may not throw an exception! |
[in] | timeout | Timeout of request, set to zero for no timeout. |
|
delete |
|
delete |
|
default |
|
default |