Skip to content

,System.Threading.SynchronizationContext)} ,System.Reactive.Concurrency.IScheduler)}

Qbservable.ObserveOn(IQbservable, SynchronizationContext) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<TSource> ObserveOn<TSource>(this IQbservable<TSource> source, SynchronizationContext context)
  • 2. public static IQbservable<TSource> ObserveOn<TSource>(this IQbservable<TSource> source, IScheduler scheduler)

1. Overload

public static IQbservable<TSource> ObserveOn<TSource>(this IQbservable<TSource> source, SynchronizationContext context)

Summary: Wraps the source sequence in order to run its observer callbacks on the specified synchronization context.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence.
contextSynchronizationContextSynchronization context to notify observers on.

Returns: IQbservable -- The source sequence whose observations happen on the specified synchronization context.

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

TypeCondition
System.ArgumentNullExceptionsource or context is null.

2. Overload

public static IQbservable<TSource> ObserveOn<TSource>(this IQbservable<TSource> source, IScheduler scheduler)

Summary: Wraps the source sequence in order to run its observer callbacks on the specified scheduler.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence.
scheduler[IScheduler](#Scheduler to notify observers on.

Returns: IQbservable -- The source sequence whose observations happen on the specified scheduler.

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

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.