,System.Reactive.Concurrency.IScheduler)} ,System.Threading.SynchronizationContext)}
Observable.ObserveOn(IObservable, IScheduler) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, IScheduler scheduler) - 2.
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, SynchronizationContext context)
1. Overload¶
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Summary: Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
scheduler | [IScheduler](# | Scheduler to notify observers on. |
Returns: IObservable
Remarks
This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects that require to be run on a scheduler, use SubscribeOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
2. Overload¶
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, SynchronizationContext context)
Summary: Wraps the source sequence in order to run its observer callbacks on the specified synchronization context.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
context | SynchronizationContext | Synchronization context to notify observers on. |
Returns: IObservable
Remarks
This only invokes observer callbacks on a synchronization context. In case the subscription and/or unsubscription actions have side-effects that require to be run on a synchronization context, use SubscribeOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or context is null. |