Commit 9c06c504 authored by Dominik Charousset's avatar Dominik Charousset

Remove `on_arg_match` wherever possible

parent 3a757e76
...@@ -149,7 +149,7 @@ message_handler fun { ...@@ -149,7 +149,7 @@ message_handler fun {
on(intproj) >> [](int i) { on(intproj) >> [](int i) {
// case 1: successfully converted a string // case 1: successfully converted a string
}, },
on_arg_match >> [](const string& str) { [](const string& str) {
// case 2: str is not an integer // case 2: str is not an integer
} }
}; };
......
...@@ -31,7 +31,7 @@ void client(event_based_actor* self, const actor& master) { ...@@ -31,7 +31,7 @@ void client(event_based_actor* self, const actor& master) {
become ( become (
on("foo", arg_match) >> [=](const string& request) { on("foo", arg_match) >> [=](const string& request) {
return self->sync_send(master, atom("bar"), request).then( return self->sync_send(master, atom("bar"), request).then(
on_arg_match >> [=](const std::string& response) { [=](const std::string& response) {
return response; return response;
} }
); );
......
...@@ -16,10 +16,10 @@ The argument to this function call \emph{must} be a match expression as shown in ...@@ -16,10 +16,10 @@ The argument to this function call \emph{must} be a match expression as shown in
\begin{lstlisting} \begin{lstlisting}
auto p0 = spawn_typed( auto p0 = spawn_typed(
on_arg_match >> [](int a, int b) { [](int a, int b) {
return static_cast<double>(a) * b; return static_cast<double>(a) * b;
}, },
on_arg_match >> [](double a, double b) { [](double a, double b) {
return std::make_tuple(a * b, a / b); return std::make_tuple(a * b, a / b);
} }
); );
......
...@@ -47,7 +47,7 @@ When sending a synchronous message, the response handler can be passed by either ...@@ -47,7 +47,7 @@ When sending a synchronous message, the response handler can be passed by either
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, atom("get")).then(
on_arg_match >> [=](const std::string& str) { [=](const std::string& str) {
// handle str // handle str
}, },
after(std::chrono::seconds(30)) >> [=]() { after(std::chrono::seconds(30)) >> [=]() {
......
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