Skip to content

,System.Func{--0,System.Threading.Tasks.ValueTask})} ,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action)} ,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action{System.Exception})} ,System.Func{--0,System.Threading.Tasks.ValueTask},System.Action{System.Exception},System.Action)}

ReactiveExtensions.SubscribeAsync(IObservable, Func) 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 SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext)
  • 2. public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action onCompleted)
  • 3. public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError)
  • 4. public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError, Action onCompleted)

1. Overload

public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext)

View source

Summary: Subscribes allowing asynchronous operations to be executed without blocking the source.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to subscribe to.
onNextFuncAction to invoke for each element in the observable sequence.

Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.

2. Overload

public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action onCompleted)

View source

Summary: Subscribes allowing asynchronous operations to be executed without blocking the source.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to subscribe to.
onNextFuncAction to invoke for each element in the observable sequence.
onCompletedActionThe on completed.

Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.

3. Overload

public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError)

View source

Summary: Subscribes allowing asynchronous operations to be executed without blocking the source.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to subscribe to.
onNextFuncAction to invoke for each element in the observable sequence.
onErrorActionThe on error.

Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.

4. Overload

public static IDisposable SubscribeAsync<T>(this IObservable<T> source, Func<T, ValueTask> onNext, Action<Exception> onError, Action onCompleted)

View source

Summary: Subscribes allowing asynchronous operations to be executed without blocking the source.

Type parameters

NameDescription
TThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to subscribe to.
onNextFuncAction to invoke for each element in the observable sequence.
onErrorActionThe on error.
onCompletedActionThe on completed.

Returns: IDisposable -- IDisposable object used to unsubscribe from the observable sequence.