,System.Threading.CancellationToken)} ,System.Threading.CancellationToken)}
Observable.RunAsync(IObservable, CancellationToken) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static AsyncSubject<TSource> RunAsync<TSource>(this IObservable<TSource> source, CancellationToken cancellationToken) - 2.
public static AsyncSubject<TSource> RunAsync<TSource>(this IConnectableObservable<TSource> source, CancellationToken cancellationToken)
1. Overload¶
public static AsyncSubject<TSource> RunAsync<TSource>(this IObservable<TSource> source, CancellationToken cancellationToken)
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. The supplied CancellationToken can be used to cancel the subscription.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence to await. |
cancellationToken | CancellationToken | Cancellation token. |
Returns: AsyncSubject
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
2. Overload¶
public static AsyncSubject<TSource> RunAsync<TSource>(this IConnectableObservable<TSource> source, CancellationToken cancellationToken)
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. The supplied CancellationToken can be used to cancel the subscription and connection.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Source sequence to await. |
cancellationToken | CancellationToken | Cancellation token. |
Returns: AsyncSubject
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |