Commit 60bf4f61 authored by Dominik Charousset's avatar Dominik Charousset

Update manual and add migration guide for 0.12

parent 7c67a86d
......@@ -174,3 +174,19 @@ The following table summarizes the changes made to the API.
Version 0.11 introduced new, optional components.
The core library itself, however, mainly received optimizations and bugfixes with one exception: the member function \lstinline^on_exit^ is no longer virtual.
You can still provide it to define a custom exit handler, but you must not use \lstinline^override^.
\clearpage
\subsubsection{0.11 $\Rightarrow$ 0.12}
Version 0.12 removed two features:
\begin{itemize}
\item
Type names are no longer demangled automatically.
Hence, users must explicitly pass the type name as first argument when using \lstinline^announce^, i.e., \lstinline^announce<my_class>(...)^ becomes \lstinline^announce<my_class>("my_class", ...)^.
\item
Synchronous send blocks no longer support \lstinline^continue_with^.
This feature has been removed without substitution.
\end{itemize}
......@@ -86,23 +86,3 @@ void foo(event_based_actor* self, actor testee) {
[=](const std::string& str) { /* handle str */ }
);
\end{lstlisting}
\clearpage
\subsubsection{Continuations for Event-based Actors}
\lib supports continuations to enable chaining of send/receive statements.
The functions \lstinline^then^ returns a helper object offering the member function \lstinline^continue_with^, which takes a functor $f$ without arguments.
After receiving a message, $f$ is invoked if and only if the received messages was handled successfully, i.e., neither \lstinline^sync_failure^ nor \lstinline^sync_timeout^ occurred.
\begin{lstlisting}
void foo(event_based_actor* self) {
actor d_or_s = ...; // replies with either a double or a string
sync_send(d_or_s, atom("get")).then(
[=](double value) { /* functor f1 */ },
[=](const string& value) { /* functor f2*/ }
).continue_with([=] {
// this continuation is invoked in both cases
// *after* f1 or f2 is done, but *not* in case
// of sync_failure or sync_timeout
});
\end{lstlisting}
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment