I'm pretty new to Akka and couldn't find the answer in the reference manual.
Suppose we have remote actors distributed in the cluster of 3 machines (A, B, C), where one actor lives on each machine and others have actorRef to 2 others, i.e.:
Machine A:
A (real actor)
-> B (ref)
-> C (ref)
Machine B:
-> A (ref)
B (real actor)
-> C (ref)
Machine C:
-> A (ref)
-> B (ref)
C (real actor)
Actor A executes following code:
bRef ! msg1
bRef ! msg2
Actor B executes following code in message handler:
case msg1 =>
cRef ! msg3
aRef ! msg4
Actor C executes following code in message handler:
case msg3 =>
aRef ! msg5
Can I make the following assumptions (if any):
actor B gets msg1 before it gets msg2
actor A gets msg5 before it gets msg4
And the follow-up question which probably leads to understanding the above: Is message sent by the ! operator through the network truly asynchronously or does it wait until the receiving mailbox gets it? I.e. does the line
bRef ! msg1
block until actor B gets the message in its mailbox or does it spawn the thread which handles the delivery and continue executing
bRef ! msg2
before it even knows that actor B got msg1?