Skip to content

)} )}

Observable.GetAwaiter(IObservable) method

Defined in

Type: Observable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static AsyncSubject<TSource> GetAwaiter<TSource>(this IObservable<TSource> source)
  • 2. public static AsyncSubject<TSource> GetAwaiter<TSource>(this IConnectableObservable<TSource> source)

1. Overload

public static AsyncSubject<TSource> GetAwaiter<TSource>(this IObservable<TSource> source)

Summary: Gets an awaiter that returns the last value of the observable sequence or throws an exception if the sequence is empty. This operation subscribes to the observable sequence, making it hot.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to await.

Returns: AsyncSubject -- Object that can be awaited.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

2. Overload

public static AsyncSubject<TSource> GetAwaiter<TSource>(this IConnectableObservable<TSource> source)

Summary: Gets an awaiter that returns the last value of the observable sequence or throws an exception if the sequence is empty. This operation subscribes and connects to the observable sequence, making it hot.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IConnectableObservable](#Source sequence to await.

Returns: AsyncSubject -- Object that can be awaited.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.