Skip to content

,ReactiveUI.Extensions.Async.AsyncContext,System.Boolean)} ,ReactiveUI.Extensions.Async.AsyncContext)} ,System.Threading.SynchronizationContext,System.Boolean)} ,System.Threading.SynchronizationContext)} ,System.Threading.Tasks.TaskScheduler,System.Boolean)} ,System.Threading.Tasks.TaskScheduler)} ,System.Reactive.Concurrency.IScheduler,System.Boolean)} ,System.Reactive.Concurrency.IScheduler)}

ObservableAsync.ObserveOn(IObservableAsync, AsyncContext, bool) method

Defined in

Type: ObservableAsync Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, AsyncContext asyncContext, bool forceYielding)
  • 2. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, AsyncContext asyncContext)
  • 3. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext, bool forceYielding)
  • 4. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext)
  • 5. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler, bool forceYielding)
  • 6. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler)
  • 7. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, IScheduler scheduler, bool forceYielding)
  • 8. public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, IScheduler scheduler)

1. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, AsyncContext asyncContext, bool forceYielding)

View source

Summary: Wraps the source observable so that observer callbacks are invoked on the specified async context.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
asyncContext[AsyncContext](#The async context on which observer callbacks should be invoked.
forceYieldingboolWhen true, forces an asynchronous yield before invoking each callback, even if already on the target context.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified context.

2. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, AsyncContext asyncContext)

View source

Summary: Wraps the source observable so that observer callbacks are invoked on the specified async context.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
asyncContext[AsyncContext](#The async context on which observer callbacks should be invoked.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified context.

3. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext, bool forceYielding)

View source

Summary: Wraps the source observable so that observer callbacks are invoked on the specified synchronization context.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
synchronizationContextSynchronizationContextThe synchronization context on which observer callbacks should be posted.
forceYieldingboolWhen true, forces an asynchronous yield before invoking each callback.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified synchronization context.

4. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext)

View source

Summary: Wraps the source observable so that observer callbacks are invoked on the specified synchronization context.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
synchronizationContextSynchronizationContextThe synchronization context on which observer callbacks should be posted.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified synchronization context.

5. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler, bool forceYielding)

View source

Summary: Wraps the source observable so that observer callbacks are invoked using the specified task scheduler.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
taskSchedulerTaskSchedulerThe task scheduler on which observer callbacks should be scheduled.
forceYieldingboolWhen true, forces an asynchronous yield before invoking each callback.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified task scheduler.

6. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler)

View source

Summary: Wraps the source observable so that observer callbacks are invoked using the specified task scheduler.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
taskSchedulerTaskSchedulerThe task scheduler on which observer callbacks should be scheduled.

Returns: IObservableAsync -- An observable sequence whose observer callbacks execute on the specified task scheduler.

7. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, IScheduler scheduler, bool forceYielding)

View source

Summary: Configures the observable sequence to notify observers on the specified scheduler.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
scheduler[IScheduler](#The scheduler on which to observe and deliver notifications to observers. Cannot be null.
forceYieldingbooltrue to force yielding to the scheduler even if already on the target context; otherwise, false.

Returns: IObservableAsync -- An observable sequence whose notifications are delivered on the specified scheduler.

Remarks

Use this method to control the context (such as a UI thread or a specific task scheduler) on which observers receive notifications. This is useful for ensuring thread safety or updating UI elements from observable sequences.

8. Overload

public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, IScheduler scheduler)

View source

Summary: Configures the observable sequence to notify observers on the specified scheduler.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
scheduler[IScheduler](#The scheduler on which to observe and deliver notifications to observers. Cannot be null.

Returns: IObservableAsync -- An observable sequence whose notifications are delivered on the specified scheduler.