Skip to content

,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)

View source

Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
dispatcherDispatcherDispatcher whose associated message loop is used to perform subscription and unsubscription actions on.

Returns: IObservable -- The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.

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

TypeCondition
System.ArgumentNullExceptionsource or dispatcher is null.

2. Overload

public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Dispatcher dispatcher, DispatcherPriority priority)

View source

Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
dispatcherDispatcherDispatcher whose associated message loop is used to to perform subscription and unsubscription actions on.
priorityDispatcherPriorityPriority to schedule work items at.

Returns: IObservable -- The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.

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

TypeCondition
System.ArgumentNullExceptionsource or dispatcher is null.

3. Overload

public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherScheduler scheduler)

View source

Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher scheduler.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
scheduler[DispatcherScheduler](#Dispatcher scheduler to perform subscription and unsubscription actions on.

Returns: IObservable -- The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher scheduler.

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

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.

4. Overload

public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject)

View source

Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the dispatcher associated with the specified object.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
dispatcherObjectDispatcherObjectObject to get the dispatcher from.

Returns: IObservable -- The source sequence whose subscriptions and unsubscriptions happen on the specified object's dispatcher.

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

TypeCondition
System.ArgumentNullExceptionsource or dispatcherObject is null.

5. Overload

public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DispatcherObject dispatcherObject, DispatcherPriority priority)

View source

Summary: Wraps the source sequence in order to run its subscription and unsubscription logic on the dispatcher associated with the specified object.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
dispatcherObjectDispatcherObjectObject to get the dispatcher from.
priorityDispatcherPriorityPriority to schedule work items at.

Returns: IObservable -- The source sequence whose subscriptions and unsubscriptions happen on the specified object's dispatcher.

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

TypeCondition
System.ArgumentNullExceptionsource or dispatcherObject is null.