libcaf  0.15.4
Public Types | Public Member Functions | List of all members
caf::response_promise Class Reference

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, mailbox_element &src)
 
 response_promise (response_promise &&)=default
 
 response_promise (const response_promise &)=default
 
response_promiseoperator= (response_promise &&)=default
 
response_promiseoperator= (const response_promise &)=default
 
template<class T , class... Ts>
std::enable_if< (sizeof...(Ts) > 0)||!std::is_convertible< T, error >::value, response_promise >::type deliver (T &&x, Ts &&...xs)
 Satisfies the promise by sending a non-error response message.
 
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.
 
response_promise deliver (error x)
 Satisfies the promise by sending an error response message. More...
 
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_ptrsource () const
 Returns the source of the corresponding request.
 
const forwarding_stack & stages () const
 Returns the remaining stages for the corresponding request.
 
message_id id () const
 Returns the message ID of the corresponding request.
 

Detailed Description

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).

Member Function Documentation

response_promise caf::response_promise::deliver ( error  x)

Satisfies the promise by sending an error response message.

For non-requests, nothing is done.


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