Class SynchronizationContextScheduler
Represents an object that schedules units of work on a provided SynchronizationContext.
Inherited Members
Namespace: System.Reactive.Concurrency
Assembly: System.Reactive.Core.dll
Syntax
public class SynchronizationContextScheduler : LocalScheduler, IScheduler, IStopwatchProvider, IServiceProvider
Constructors
| Improve this Doc View SourceSynchronizationContextScheduler(SynchronizationContext)
Creates an object that schedules units of work on the provided SynchronizationContext.
Declaration
public SynchronizationContextScheduler(SynchronizationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| SynchronizationContext | context | Synchronization context to schedule units of work on. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
SynchronizationContextScheduler(SynchronizationContext, Boolean)
Creates an object that schedules units of work on the provided SynchronizationContext.
Declaration
public SynchronizationContextScheduler(SynchronizationContext context, bool alwaysPost)
Parameters
| Type | Name | Description |
|---|---|---|
| SynchronizationContext | context | Synchronization context to schedule units of work on. |
| Boolean | alwaysPost | Configures whether scheduling always posts to the synchronization context, regardless whether the caller is on the same synchronization context. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Methods
| Improve this Doc View SourceSchedule<TState>(TState, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed.
Declaration
public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
Parameters
| Type | Name | Description |
|---|---|---|
| TState | state | State passed to the action to be executed. |
| Func<IScheduler, TState, IDisposable> | action | Action to be executed. |
Returns
| Type | Description |
|---|---|
| IDisposable | The disposable object used to cancel the scheduled action (best effort). |
Type Parameters
| Name | Description |
|---|---|
| TState | The type of the state passed to the scheduled action. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Schedule<TState>(TState, TimeSpan, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed after dueTime.
Declaration
public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
Parameters
| Type | Name | Description |
|---|---|---|
| TState | state | State passed to the action to be executed. |
| TimeSpan | dueTime | Relative time after which to execute the action. |
| Func<IScheduler, TState, IDisposable> | action | Action to be executed. |
Returns
| Type | Description |
|---|---|
| IDisposable | The disposable object used to cancel the scheduled action (best effort). |
Type Parameters
| Name | Description |
|---|---|
| TState | The type of the state passed to the scheduled action. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|