This is explained in the Actors section, the section of documents with a large warning sign:
A warning. When using future callbacks inside participants, you should carefully avoid closing the link to the contained actors, i.e. do not call methods or access to mutable state on the surrounding actor from in the callback. This will violate the encapsulation of the actor and may introduce synchronization errors and race conditions, since the callback will be scheduled at the same time as the surrounding actor. Unfortunately, there is as yet no way to detect these illegal calls at compile time. See Also: Actors and General Mutable State
It also explains:
http://doc.akka.io/docs/akka/2.0.2/general/jmm.html#jmm-shared-state
When you close "getSender ()", you really close "this.getSender ()", which means that you are closing the internal state of the actor, which is not mentioned in the docs above.
I will add this to our FAQ.
Happy hakking,
β
source share