system.spawn([&](caf::event_based_actor *self) {self->set_default_handler([=](caf::scheduled_actor *, caf::message_view &view) -> caf::result<caf::message> {std::cout << "DEFAULT: " << view.content().stringify() << std::endl;self->quit();return caf::message(caf::none);});self->send(actorPool.actor(), something);
});
system.spawn([&](caf::event_based_actor *self) {self->set_default_handler([=](caf::scheduled_actor *, caf::message_view &view) -> caf::result<caf::message> {std::cout << "DEFAULT: " << view.content().stringify() << std::endl;self->quit();return caf::message(caf::none);});self->send(actorPool.actor(), something);
return caf::behavior{ []{} };});
On Tuesday, December 20, 2016 at 9:07:29 PM UTC-5, Eric Pederson wrote:Dear all:I need to send a message and get back a response that I won't know the type of.If I use send like in the below, the default handler is never triggered.I've also tried to use request().then(others >> [](message_view &view) { /* handle */ } but others doesn't appear to work for then().system.spawn([&](caf::event_based_actor *self) {self->set_default_handler([=](caf::scheduled_actor *, caf::message_view &view) -> caf::result<caf::message> {std::cout << "DEFAULT: " << view.content().stringify() << std::endl;self->quit();return caf::message(caf::none);});self->send(actorPool.actor(), something);
});Is there a way to do what I'm trying to do? I can't change the target actor which handles something.
--
You received this message because you are subscribed to the Google Groups "actor-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actor-framewo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to actor-framework+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "actor-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/actor-framework/QOiGYAV_bY8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to actor-framework+unsubscribe@googlegroups.com.