,System.Windows.Threading.Dispatcher)} ,System.Windows.Threading.Dispatcher,System.Windows.Threading.DispatcherPriority)} ,System.Reactive.Concurrency.DispatcherScheduler)} ,System.Windows.Threading.DispatcherObject)} ,System.Windows.Threading.DispatcherObject,System.Windows.Threading.DispatcherPriority)}
DispatcherObservable.SubscribeOn(IObservable, Dispatcher) method¶
Defined in
Type: DispatcherObservable
Namespace: System.Reactive.Linq
Assembly: ReactiveUI.Wpf.dll
Applies to
net462
Overloads¶
- 1.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Dispatcher dispatcher) - 2.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Dispatcher dispatcher, DispatcherPriority priority) - 3.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherScheduler scheduler) - 4.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject) - 5.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject, DispatcherPriority priority)
1. Overload¶
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Dispatcher dispatcher)
Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
dispatcher | Dispatcher | Dispatcher whose associated message loop is used to perform subscription and unsubscription actions on. |
Returns: IObservable
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher. In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use ObserveOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or dispatcher is null. |
2. Overload¶
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Dispatcher dispatcher, DispatcherPriority priority)
Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
dispatcher | Dispatcher | Dispatcher whose associated message loop is used to to perform subscription and unsubscription actions on. |
priority | DispatcherPriority | Priority to schedule work items at. |
Returns: IObservable
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher. In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use ObserveOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or dispatcher is null. |
3. Overload¶
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherScheduler scheduler)
Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher scheduler.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
scheduler | [DispatcherScheduler](# | Dispatcher scheduler to perform subscription and unsubscription actions on. |
Returns: IObservable
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified scheduler. In order to invoke observer callbacks on the specified scheduler, e.g. to render results in a control, use ObserveOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
4. Overload¶
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject)
Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the dispatcher associated with the specified object.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
dispatcherObject | DispatcherObject | Object to get the dispatcher from. |
Returns: IObservable
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object. In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use ObserveOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or dispatcherObject is null. |
5. Overload¶
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject, DispatcherPriority priority)
Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the dispatcher associated with the specified object.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
dispatcherObject | DispatcherObject | Object to get the dispatcher from. |
priority | DispatcherPriority | Priority to schedule work items at. |
Returns: IObservable
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object. In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use ObserveOn.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or dispatcherObject is null. |