,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)
Summary: Wraps the source observable so that observer callbacks are invoked on the specified async context.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
asyncContext | [AsyncContext](# | The async context on which observer callbacks should be invoked. |
forceYielding | bool | When true, forces an asynchronous yield before invoking each callback, even if already on the target context. |
Returns: IObservableAsync
2. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, AsyncContext asyncContext)
Summary: Wraps the source observable so that observer callbacks are invoked on the specified async context.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
asyncContext | [AsyncContext](# | The async context on which observer callbacks should be invoked. |
Returns: IObservableAsync
3. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext, bool forceYielding)
Summary: Wraps the source observable so that observer callbacks are invoked on the specified synchronization context.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
synchronizationContext | SynchronizationContext | The synchronization context on which observer callbacks should be posted. |
forceYielding | bool | When true, forces an asynchronous yield before invoking each callback. |
Returns: IObservableAsync
4. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, SynchronizationContext synchronizationContext)
Summary: Wraps the source observable so that observer callbacks are invoked on the specified synchronization context.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
synchronizationContext | SynchronizationContext | The synchronization context on which observer callbacks should be posted. |
Returns: IObservableAsync
5. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler, bool forceYielding)
Summary: Wraps the source observable so that observer callbacks are invoked using the specified task scheduler.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
taskScheduler | TaskScheduler | The task scheduler on which observer callbacks should be scheduled. |
forceYielding | bool | When true, forces an asynchronous yield before invoking each callback. |
Returns: IObservableAsync
6. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, TaskScheduler taskScheduler)
Summary: Wraps the source observable so that observer callbacks are invoked using the specified task scheduler.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
taskScheduler | TaskScheduler | The task scheduler on which observer callbacks should be scheduled. |
Returns: IObservableAsync
7. Overload¶
public static IObservableAsync<T> ObserveOn<T>(this IObservableAsync<T> @this, IScheduler scheduler, bool forceYielding)
Summary: Configures the observable sequence to notify observers on the specified scheduler.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
scheduler | [IScheduler](# | The scheduler on which to observe and deliver notifications to observers. Cannot be null. |
forceYielding | bool | true to force yielding to the scheduler even if already on the target context; otherwise, false. |
Returns: IObservableAsync
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)
Summary: Configures the observable sequence to notify observers on the specified scheduler.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
scheduler | [IScheduler](# | The scheduler on which to observe and deliver notifications to observers. Cannot be null. |
Returns: IObservableAsync