在C#中,类和接口可以有event:
public class Foo
{
    public event Action SomethingHappened;
    public void DoSomething()
    {
        // yes, i'm aware of the potential NRE
        this.SomethingHappened();
    }
}
这有助于以最少的样板代码进行基于推送的通知,并启用多用户模型,以便许多观察者可以监听事件:
var foo = new Foo();
foo.SomethingHappened += () => Console.WriteLine("Yay!");
foo.DoSomething();  // "Yay!" appears on console. 
Scala中有相同的成语吗?我正在寻找的是:
在Scala文档中使用它的例子非常棒.我不是在寻找Scala中C#事件的实现.相反,我正在寻找Scala中的等效成语.