重写bang(!)运算符。查找发件人

时间:2012-11-29 02:47:11

标签: scala

当我在Scala中覆盖bang(!)运算符时,它会在作为消息接收者的actor上调用。有没有办法可以找出谁将这个msg发送到被覆盖的bang运算符中的这个actor?

谢谢,

1 个答案:

答案 0 :(得分:4)

请在此处查看如何覆盖bang运算符的行为。在您的特定情况下,您可以通过将原始邮件包装在包含发件人的信封中来覆盖它。

  
    

How to override bang operator(!) for different type of inputs in scala

         

How to overload bang(!) operator in Scala Actor model?

  

另请注意,Scala 2.9的actors API将被弃用。请考虑使用Akka而不是提供您正在寻找的功能。

相关问题