Scheduler.Yield(IScheduler) method¶
Defined in
Type: Scheduler
Namespace: System.Reactive.Concurrency
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static SchedulerOperation Yield(this IScheduler scheduler) - 2.
public static SchedulerOperation Yield(this IScheduler scheduler, CancellationToken cancellationToken)
1. Overload¶
public static SchedulerOperation Yield(this IScheduler scheduler)
Summary: Yields execution of the current work item on the scheduler to another work item on the scheduler. The caller should await the result of calling Yield to schedule the remainder of the current work item (known as the continuation).
Parameters
| Name | Type | Description |
|---|---|---|
scheduler | [IScheduler](# | Scheduler to yield work on. |
Returns: SchedulerOperation -- Scheduler operation object to await in order to schedule the continuation.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | scheduler is null. |
2. Overload¶
public static SchedulerOperation Yield(this IScheduler scheduler, CancellationToken cancellationToken)
Summary: Yields execution of the current work item on the scheduler to another work item on the scheduler. The caller should await the result of calling Yield to schedule the remainder of the current work item (known as the continuation).
Parameters
| Name | Type | Description |
|---|---|---|
scheduler | [IScheduler](# | Scheduler to yield work on. |
cancellationToken | CancellationToken | Cancellation token to cancel the continuation to run. |
Returns: SchedulerOperation -- Scheduler operation object to await in order to schedule the continuation.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | scheduler is null. |