Class HistoricalSchedulerBase
Base class for historical schedulers, which are virtual time schedulers that use DateTimeOffset for absolute time and TimeSpan for relative time.
Inheritance
Inherited Members
Namespace: System.Reactive.Concurrency
Assembly: System.Reactive.Linq.dll
Syntax
public abstract class HistoricalSchedulerBase : VirtualTimeSchedulerBase<DateTimeOffset, TimeSpan>, IScheduler, IServiceProvider, IStopwatchProvider
Constructors
| Improve this Doc View SourceHistoricalSchedulerBase()
Creates a new historical scheduler with the minimum value of DateTimeOffset as the initial clock value.
Declaration
protected HistoricalSchedulerBase()
HistoricalSchedulerBase(DateTimeOffset)
Creates a new historical scheduler with the specified initial clock value.
Declaration
protected HistoricalSchedulerBase(DateTimeOffset initialClock)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | initialClock | Initial clock value. |
HistoricalSchedulerBase(DateTimeOffset, IComparer<DateTimeOffset>)
Creates a new historical scheduler with the specified initial clock value and absolute time comparer.
Declaration
protected HistoricalSchedulerBase(DateTimeOffset initialClock, IComparer<DateTimeOffset> comparer)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | initialClock | Initial value for the clock. |
IComparer<DateTimeOffset> | comparer | Comparer to determine causality of events based on absolute time. |
Methods
| Improve this Doc View SourceAdd(DateTimeOffset, TimeSpan)
Adds a relative time value to an absolute time value.
Declaration
protected override DateTimeOffset Add(DateTimeOffset absolute, TimeSpan relative)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | absolute | Absolute time value. |
TimeSpan | relative | Relative time value to add. |
Returns
Type | Description |
---|---|
DateTimeOffset | The resulting absolute time sum value. |
Overrides
ToDateTimeOffset(DateTimeOffset)
Converts the absolute time value to a DateTimeOffset value.
Declaration
protected override DateTimeOffset ToDateTimeOffset(DateTimeOffset absolute)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | absolute | Absolute time value to convert. |
Returns
Type | Description |
---|---|
DateTimeOffset | The corresponding DateTimeOffset value. |
Overrides
ToRelative(TimeSpan)
Converts the TimeSpan value to a relative time value.
Declaration
protected override TimeSpan ToRelative(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeSpan | TimeSpan value to convert. |
Returns
Type | Description |
---|---|
TimeSpan | The corresponding relative time value. |