-
-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Is there an equivalent of a sender attribute on the actor?
This is to allow me to send messages to the "sender" --- and is drastically different from the "ask" semantics.
Consider, for example, a child actor keeping track of "failures" and sending a message to parent saying "Failure Limit Reached".
In this case the semantics of the parent would be something like this:
- Spawn Child actor.
- Listen to "Failure Limit Reached" messages and restart or replace child actor with a new one.
This cannot be accomplished with an "ask" --- since once the child is spawned, the parent cares not for it and carries on with its duties.
P.S.: As a side note, documentation seems to favor the "ask" way of doing things (see "replying to messages" in pykka docs), which is not how the general actor system usually functions. The preferred way is to use "tell" and only resort to "ask" in select cases. Akka also prefers tell:
http://doc.akka.io/docs/akka/snapshot/scala/actors.html