Created
July 19, 2016 22:30
-
-
Save 74hc595/73f0c708cfde56d9413ff54faac5c324 to your computer and use it in GitHub Desktop.
Blocking actor API seems to not work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <caf/all.hpp> | |
using std::chrono::seconds; | |
using namespace caf; | |
void my_blocking_actor_fn(blocking_actor *self) | |
{ | |
self->receive( | |
[](int val) -> int { return val*2; } /* never called */ | |
); | |
} | |
void caf_main(actor_system &system) | |
{ | |
auto actor1 = system.spawn(my_blocking_actor_fn); | |
scoped_actor self{system}; | |
/* always times out */ | |
self->request(actor1, seconds(1), 99).receive( | |
[&](int val) { aout(self) << "return value was " << val << std::endl; }, | |
[&](error &err) { aout(self) << err << std::endl; } | |
); | |
} | |
CAF_MAIN() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment