ObservableExtensions.SubscribeSafe(IObservable, IObserver) method¶
Defined in
Type: ObservableExtensions
Namespace: System
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Attributes: [EditorBrowsable(EditorBrowsableState.2)]
public static IDisposable SubscribeSafe<T>(this IObservable<T> source, IObserver<T> observer)
Summary: Subscribes to the specified source, re-routing synchronous exceptions during invocation of the Subscribe method to the observer's OnError channel. This method is typically used when writing query operators.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Observable sequence to subscribe to. |
observer | IObserver | Observer that will be passed to the observable sequence, and that will be used for exception propagation. |
Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or observer is null. |