@@ -23,17 +23,6 @@ It is not possible to transfer a handle to a response to another actor.
...
@@ -23,17 +23,6 @@ It is not possible to transfer a handle to a response to another actor.
\end{itemize}
\end{itemize}
\subsection{Sending Messages}
\begin{itemize}
\item
\lstinline^send(whom, ...)^ is defined as \lstinline^send_tuple(whom, make_message(...))^.
Hence, a message sent via \lstinline^send(whom, self->last_dequeued())^ will not yield the expected result, since it wraps \lstinline^self->last_dequeued()^ into another \lstinline^message^ instance.
The correct way of forwarding messages is \lstinline^self->forward_to(whom)^.
Messages can be delayed, e.g., to implement time-based polling strategies, by using one of \lstinline^delayed_send^, \lstinline^delayed_send_tuple^, \lstinline^delayed_reply^, or \lstinline^delayed_reply_tuple^.
Messages can be delayed by using the function \lstinline^delayed_send^.
The following example illustrates a polling strategy using \lstinline^delayed_send^.
A synchronous message is sent to the receiving actor's mailbox like any other asynchronous message.
A synchronous message is sent to the receiving actor's mailbox like any other (asynchronous) message.
The response message, on the other hand, is treated separately.
The response message, on the other hand, is treated separately.
The difference between \lstinline^sync_send^ and \lstinline^timed_sync_send^ is how timeouts are handled.
The difference between \lstinline^sync_send^ and \lstinline^timed_sync_send^ is how timeouts are handled.
The behavior of \lstinline^sync_send^ is analogous to \lstinline^send^, i.e., timeouts are specified by using \lstinline^after(...)^ statements (see \ref{Sec::Receive::Timeouts}).
The behavior of \lstinline^sync_send^ is analogous to \lstinline^send^, i.e., timeouts are specified by using \lstinline^after(...)^ statements (see Section \ref{Sec::Receive::Timeouts}).
When using \lstinline^timed_sync_send^ function, \lstinline^after(...)^ statements are ignored and the actor will receive a \lstinline^sync_timeout_msg^ after the given duration instead.
When using \lstinline^timed_sync_send^ function, \lstinline^after(...)^ statements are ignored and the actor will receive a \lstinline^sync_timeout_msg^ after the given duration instead.
\subsection{Error Messages}
\subsection{Error Messages}
...
@@ -46,7 +39,7 @@ When sending a synchronous message, the response handler can be passed by either
...
@@ -46,7 +39,7 @@ When sending a synchronous message, the response handler can be passed by either
\begin{lstlisting}
\begin{lstlisting}
void foo(event_based_actor* self, actor testee) {
void foo(event_based_actor* self, actor testee) {
// testee replies with a string to 'get'
// testee replies with a string to 'get'
self->sync_send(testee, atom("get")).then(
self->sync_send(testee, get_atom::value).then(
[=](const std::string& str) {
[=](const std::string& str) {
// handle str
// handle str
},
},
...
@@ -82,7 +75,7 @@ void foo(event_based_actor* self, actor testee) {
...
@@ -82,7 +75,7 @@ void foo(event_based_actor* self, actor testee) {