C#中IobServer和IobServable的区别

Difference between IobServer and IobServable in c#

任何人都可以解释一下 c# 中 IObServerIObServable 之间的区别吗?

两者的文档看起来非常相似。那么,我想知道IObServer<T>IObServable<T>应该在什么场景下使用?

Documentation 自己清楚:

The IObservable interface represents the class that sends notifications (the provider); the IObserver interface represents the class that receives them (the observer). T represents the class that provides the notification information.

所以换句话说:IObservable 是将通知推送到频道的人,IObserver 是订阅的人,开始接收通知。

来自 MSDN:https://msdn.microsoft.com/en-us/library/dd783449%28v=vs.110%29.aspx

IObserver<T>IObservable<T> 接口为基于推送的通知提供了通用机制,也称为观察者设计模式。

The IObservable<T> interface represents the class that sends notifications (the provider);

The IObserver<T> interface represents the class that receives them (the observer).

T代表提供通知信息的class