ObservableExtensions.Subscribe<TSource> Method (IObservable<TSource>, Action<TSource>, Action<Exception>, Action)
Subscribes an element handler, an exception handler, and a completion handler to an observable sequence.
Namespace: System
Assembly: System.Reactive (in System.Reactive.dll)
public static IDisposable Subscribe<TSource>( this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted )
Type Parameters
- TSource
Parameters
- source
- Type: System.IObservable<TSource>
Observable sequence to subscribe to.
- onNext
- Type: System.Action<TSource>
Action to invoke for each element in the observable sequence.
- onError
- Type: System.Action<Exception>
Action to invoke upon exceptional termination of the observable sequence.
- onCompleted
- Type: System.Action
Action to invoke upon graceful termination of the observable sequence.
Return Value
Type: System.IDisposableIDisposable object used to unsubscribe from the observable sequence.