,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action{System.Exception},System.Action)} ,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action{System.Exception})} ,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action)} ,System.Func{--0,System.Threading.Tasks.ValueTask})}
ReactiveExtensions.SubscribeSynchronous(IObservable, Func, Action, Action) method¶
Defined in
Type: ReactiveExtensions
Namespace: ReactiveUI.Extensions
Assembly: ReactiveUI.Extensions.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Overloads¶
- 1.
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError, Action onCompleted) - 2.
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError) - 3.
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action onCompleted) - 4.
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext)
1. Overload¶
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError, Action onCompleted)
Summary: Subscribes to the specified source synchronously.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The source. |
onNext | Func | The on next. |
onError | Action | The on error. |
onCompleted | Action | The on completed. |
Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.
2. Overload¶
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError)
Summary: Subscribes an element handler and an exception handler to an observable sequence synchronously.
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. |
onNext | Func | Action to invoke for each element in the observable sequence. |
onError | Action | Action to invoke upon exceptional termination of the observable sequence. |
Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.
3. Overload¶
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action onCompleted)
Summary: Subscribes an element handler and a completion handler to an observable sequence synchronously.
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. |
onNext | Func | Action to invoke for each element in the observable sequence. |
onCompleted | Action | Action to invoke upon graceful termination of the observable sequence. |
Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onCompleted is null. |
4. Overload¶
public static IDisposable SubscribeSynchronous<T>(this IObservable<T> source, Func<T, ValueTask> onNext)
Summary: Subscribes an element handler to an observable sequence synchronously.
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. |
onNext | Func | Action to invoke for each element in the observable sequence. |
Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.