Skip to content

Commit

Permalink
Merge pull request #140 from Bigpet/calleefix
Browse files Browse the repository at this point in the history
add a seperate future for each provide
  • Loading branch information
Tobias Oberstein committed Sep 14, 2016
2 parents a189702 + a484549 commit 5d081f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/callee.cpp
Expand Up @@ -92,7 +92,8 @@ int main(int argc, char** argv)
boost::future<void> connect_future;
boost::future<void> start_future;
boost::future<void> join_future;
boost::future<void> provide_future;
boost::future<void> provide_future_add;
boost::future<void> provide_future_longop;

connect_future = transport->connect().then([&](boost::future<void> connected) {
try {
Expand Down Expand Up @@ -125,7 +126,7 @@ int main(int argc, char** argv)
return;
}

provide_future = session->provide("com.examples.calculator.add2", &add2).then(
provide_future_add = session->provide("com.examples.calculator.add2", &add2).then(
[&](boost::future<autobahn::wamp_registration> registration) {
try {
std::cerr << "registered procedure:" << registration.get().id() << std::endl;
Expand All @@ -136,7 +137,7 @@ int main(int argc, char** argv)
}
});

provide_future = session->provide("com.myapp.longop", &longop).then(
provide_future_longop = session->provide("com.myapp.longop", &longop).then(
[&](boost::future<autobahn::wamp_registration> registration) {
try {
std::cerr << "registered procedure:" << registration.get().id() << std::endl;
Expand Down

0 comments on commit 5d081f7

Please sign in to comment.