What is the Action returned by the subscribe parameter of IObservable.Create actually for?
Posted
by
James Hay
on Stack Overflow
See other posts from Stack Overflow
or by James Hay
Published on 2010-12-22T18:34:59Z
Indexed on
2010/12/22
18:54 UTC
Read the original article
Hit count: 271
The method definition of IObservable.Create is:
public static IObservable<TSource> Create<TSource>(
Func<IObserver<TSource>, Action> subscribe
)
I get that the function is called once the observable is subscribed to, where by I can then call OnNext, OnError and OnComplete on the observer. But why do I need to return an Action from the subscibe parameter and when will it actually be called?
© Stack Overflow or respective owner