Reputation: 9
I read the code of Reactive Extension, then I find this code
private readonly IObservable<TSource> _source;
protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
{
var sink = new _(this, observer, cancel);
setSink(sink);
return _source.SubscribeSafe(sink);
}
I find that the method SubscribeSafe(sink)
is in the class ObservableExtensions
, and the class isn't implement the interface IObservable
. Why the parameter _source have the member function SubscribeSafe
()?
Upvotes: 0
Views: 320