A trivial example program.
#include <string>
#include <iostream>
#include "caf/actor_ostream.hpp"
#include "caf/actor_system.hpp"
#include "caf/caf_main.hpp"
#include "caf/event_based_actor.hpp"
return {
[=](const std::string& what) -> std::string {
aout(
self) << what << std::endl;
return std::string{what.rbegin(), what.rend()};
},
};
}
self->request(buddy, std::chrono::seconds(10), "Hello World!")
.then(
[=](const std::string& what) {
aout(
self) << what << std::endl;
});
}
auto mirror_actor = sys.
spawn(mirror);
sys.
spawn(hello_world, mirror_actor);
}
CAF_MAIN()