Enables event-based actors to generate messages from a user-defined data exchange format such as JSON and to send the generated messages to another (typed) actor.
More...
#include <mtl.hpp>
|
| event_based_mtl (Self *self, Adapter adapter, Reader *reader) noexcept |
|
| event_based_mtl (const event_based_mtl &) noexcept=default |
|
event_based_mtl & | operator= (const event_based_mtl &) noexcept=default |
|
auto | self () |
|
auto & | adapter () |
|
auto & | reader () |
|
template<class... Fs> |
bool | try_send (const typed_actor< Fs... > &dst) |
| Tries to get a message from the reader that matches any of the accepted inputs of dst and sends the converted messages on success. More...
|
|
template<class... Fs, class Timeout , class OnResult , class OnError > |
bool | try_request (const typed_actor< Fs... > &dst, Timeout timeout, OnResult on_result, OnError on_error) |
| Tries to get a message from the reader that matches any of the accepted inputs of dst and sends a request message to dst on success. More...
|
|
template<class Self, class Adapter, class Reader>
class caf::event_based_mtl< Self, Adapter, Reader >
Enables event-based actors to generate messages from a user-defined data exchange format such as JSON and to send the generated messages to another (typed) actor.
◆ try_request()
template<class Self , class Adapter , class Reader >
template<class... Fs, class Timeout , class OnResult , class OnError >
bool caf::event_based_mtl< Self, Adapter, Reader >::try_request |
( |
const typed_actor< Fs... > & |
dst, |
|
|
Timeout |
timeout, |
|
|
OnResult |
on_result, |
|
|
OnError |
on_error |
|
) |
| |
|
inline |
Tries to get a message from the reader that matches any of the accepted inputs of dst
and sends a request message to dst
on success.
- Parameters
-
dst | The destination for the next message. |
timeout | The relative timeout for the request message. |
on_result | The one-shot handler for the response message. This function object must accept all possible response types from dst . |
on_error | The one-shot handler for timeout and other errors. |
- Returns
true
if the adapter was able to generate and send a message, false
otherwise.
◆ try_send()
template<class Self , class Adapter , class Reader >
template<class... Fs>
Tries to get a message from the reader that matches any of the accepted inputs of dst
and sends the converted messages on success.
- Parameters
-
dst | The destination for the next message. |
- Returns
true
if the adapter was able to generate and send a message, false
otherwise.
The documentation for this class was generated from the following file: