libcaf
0.16.3
|
A response promise can be used to deliver a uniquely identifiable response message from the server (i.e. More...
#include <response_promise.hpp>
Public Types | |
using | forwarding_stack = std::vector< strong_actor_ptr > |
Public Member Functions | |
response_promise () | |
Constructs an invalid response promise. | |
response_promise (none_t) | |
response_promise (strong_actor_ptr self, strong_actor_ptr source, forwarding_stack stages, message_id id) | |
response_promise (strong_actor_ptr self, mailbox_element &src) | |
response_promise (response_promise &&)=default | |
response_promise (const response_promise &)=default | |
response_promise & | operator= (response_promise &&)=default |
response_promise & | operator= (const response_promise &)=default |
template<class T , class... Ts> | |
detail::enable_if_t<((sizeof...(Ts) > 0)||(!std::is_convertible< T, error >::value &&!std::is_same< detail::decay_t< T >, unit_t >::value)) &&!detail::is_expected< detail::decay_t< T > >::value > | deliver (T &&x, Ts &&... xs) |
Satisfies the promise by sending a non-error response message. | |
template<class T > | |
void | deliver (expected< T > x) |
template<message_priority P = message_priority::normal, class Handle = actor, class... Ts> | |
response_type< typename Handle::signatures, detail::implicit_conversions_t< typename std::decay< Ts >::type >... >::delegated_type | delegate (const Handle &dest, Ts &&... xs) |
Satisfies the promise by delegating to another actor. | |
void | deliver (error x) |
Satisfies the promise by sending an error response message. | |
void | deliver (unit_t x) |
Satisfies the promise by sending an empty message if this promise has a valid message ID, i.e., async() == false . | |
bool | async () const |
Returns whether this response promise replies to an asynchronous message. | |
bool | pending () const |
Queries whether this promise is a valid promise that is not satisfied yet. | |
const strong_actor_ptr & | source () const |
Returns the source of the corresponding request. | |
const forwarding_stack & | stages () const |
Returns the remaining stages for the corresponding request. | |
strong_actor_ptr | next () const |
Returns the actor that will receive the response, i.e., stages().front() if !stages().empty() or source() otherwise. | |
message_id | id () const |
Returns the message ID of the corresponding request. | |
A response promise can be used to deliver a uniquely identifiable response message from the server (i.e.
receiver of the request) to the client (i.e. the sender of the request).