When I override the bang (!) operator in Scala, it’s invoked on the actor which is the recipient of the message. Is there a way I can find out who sent this msg to this actor inside the overridden bang operator?
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please see here how to override the behavior of the bang operator. In your particular case you can override it by wrapping the original message in an envelop containing the sender.
Also, please note that the Scala 2.9’s actors API will become deprecated. Consider using Akka instead which does provide the functionality you are looking for.