What happens to the answer if the sender-actor has already left?

Consider the following example. A hello_world actorsends the string "hello" to mirror actor, and then terminates immediately. What will happen to the answer worldreturned with mirror actor? Ignored? Left in your inbox hello_world actor? Can a mirror know that his answer is lost?

behavior mirror(event_based_actor* self)
{
    return { [=](std::string s){ return "world"; } };
}
void hello_world(event_based_actor* self, const actor& theMirror)
{
    self->send(theMirror, "hello");
}
+4
source share
1 answer

Consider the following example. The hello_world actor sends the string "hello" to the mirror actor, then it ends immediately. What will happen to the response world returned from the mirror actor? Ignored? Remained in the hello_world inbox?

, hello_world . CAF mirror , return "world" . , .

mirror , ?

TL; DR: , .

: , . . , , , hello_world , , DOWN , hello_world. mirror , DOWN. , mirror , .

: mirror , , . . CAF , , , , , mirror , mirror. DOWN mirror , , mirror .

, , . , , .

+5

Source: https://habr.com/ru/post/1620776/


All Articles