Class VirtualTimeScheduler<TAbsolute, TRelative>
Base class for virtual time schedulers using a priority queue for scheduled items.
Inheritance
Inherited Members
Namespace: System.Reactive.Concurrency
Assembly: System.Reactive.Linq.dll
Syntax
public abstract class VirtualTimeScheduler<TAbsolute, TRelative> : VirtualTimeSchedulerBase<TAbsolute, TRelative>, IScheduler, IServiceProvider, IStopwatchProvider where TAbsolute : IComparable<TAbsolute>
Type Parameters
Name | Description |
---|---|
TAbsolute | Absolute time representation type. |
TRelative | Relative time representation type. |
Constructors
| Improve this Doc View SourceVirtualTimeScheduler()
Creates a new virtual time scheduler with the default value of TAbsolute as the initial clock value.
Declaration
protected VirtualTimeScheduler()
VirtualTimeScheduler(TAbsolute, IComparer<TAbsolute>)
Creates a new virtual time scheduler.
Declaration
protected VirtualTimeScheduler(TAbsolute initialClock, IComparer<TAbsolute> comparer)
Parameters
Type | Name | Description |
---|---|---|
TAbsolute | initialClock | Initial value for the clock. |
IComparer<TAbsolute> | comparer | Comparer to determine causality of events based on absolute time. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Methods
| Improve this Doc View SourceGetNext()
Gets the next scheduled item to be executed.
Declaration
protected override IScheduledItem<TAbsolute> GetNext()
Returns
Type | Description |
---|---|
IScheduledItem<TAbsolute> | The next scheduled item. |
Overrides
ScheduleAbsolute<TState>(TState, TAbsolute, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed at dueTime.
Declaration
public override IDisposable ScheduleAbsolute<TState>(TState state, TAbsolute dueTime, Func<IScheduler, TState, IDisposable> action)
Parameters
Type | Name | Description |
---|---|---|
TState | state | State passed to the action to be executed. |
TAbsolute | dueTime | Absolute time at 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 |
|