Can an Actors responder that uses a local thread variable throw an error?

I noticed that Actor reply calls the reply method of a local thread variable of type ReplyReactor (see the private rawSelf method). This reply method sends a message to senders.head , where senders is the list of senders (see source ).

Now I am wondering if this might cause an error. What if two members share the same thread with the local instance of the ReplyReactor ? Is there a scenario where one of the participants answers the wrong sender?

+2
source share
1 answer

Actors do exchange threads, but they cannot be interrupted. They will work until the next react or end of the loop , after which they cannot reply anymore, before executing other react or receive .

+4
source

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


All Articles