Search Results for

    Show / Hide Table of Contents

    Class VirtualTimeScheduler<TAbsolute, TRelative>

    Base class for virtual time schedulers using a priority queue for scheduled items.

    Inheritance
    Object
    VirtualTimeSchedulerBase<TAbsolute, TRelative>
    VirtualTimeScheduler<TAbsolute, TRelative>
    Implements
    IScheduler
    IServiceProvider
    IStopwatchProvider
    Inherited Members
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Add(TAbsolute, TRelative)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.ToDateTimeOffset(TAbsolute)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.ToRelative(TimeSpan)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.IsEnabled
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Comparer
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.ScheduleAbsolute<TState>(TState, TAbsolute, Func<IScheduler, TState, IDisposable>)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.ScheduleRelative<TState>(TState, TRelative, Func<IScheduler, TState, IDisposable>)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Schedule<TState>(TState, Func<IScheduler, TState, IDisposable>)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Schedule<TState>(TState, TimeSpan, Func<IScheduler, TState, IDisposable>)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Schedule<TState>(TState, DateTimeOffset, Func<IScheduler, TState, IDisposable>)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Start()
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Stop()
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.AdvanceTo(TAbsolute)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.AdvanceBy(TRelative)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Sleep(TRelative)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Clock
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.Now
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.GetNext()
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.IServiceProvider.GetService(Type)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.GetService(Type)
    VirtualTimeSchedulerBase<TAbsolute, TRelative>.StartStopwatch()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ToString()
    Object.ReferenceEquals(Object, Object)
    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 Source

    VirtualTimeScheduler()

    Creates a new virtual time scheduler with the default value of TAbsolute as the initial clock value.

    Declaration
    protected VirtualTimeScheduler()
    | Improve this Doc View Source

    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

    comparer is null.

    Methods

    | Improve this Doc View Source

    GetNext()

    Gets the next scheduled item to be executed.

    Declaration
    protected override IScheduledItem<TAbsolute> GetNext()
    Returns
    Type Description
    IScheduledItem<TAbsolute>

    The next scheduled item.

    Overrides
    System.Reactive.Concurrency.VirtualTimeSchedulerBase<TAbsolute, TRelative>.GetNext()
    | Improve this Doc View Source

    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
    System.Reactive.Concurrency.VirtualTimeSchedulerBase<TAbsolute, TRelative>.ScheduleAbsolute<TState>(TState, TAbsolute, System.Func<System.Reactive.Concurrency.IScheduler, TState, System.IDisposable>)
    Exceptions
    Type Condition
    ArgumentNullException

    action is null.

    Implements

    IScheduler
    System.IServiceProvider
    IStopwatchProvider

    Extension Methods

    VirtualTimeSchedulerExtensions.ScheduleRelative<TAbsolute, TRelative>(VirtualTimeSchedulerBase<TAbsolute, TRelative>, TRelative, Action)
    VirtualTimeSchedulerExtensions.ScheduleAbsolute<TAbsolute, TRelative>(VirtualTimeSchedulerBase<TAbsolute, TRelative>, TAbsolute, Action)
    Scheduler.DisableOptimizations(IScheduler)
    Scheduler.DisableOptimizations(IScheduler, Type[])
    Scheduler.Catch<TException>(IScheduler, Func<TException, Boolean>)
    Scheduler.SchedulePeriodic<TState>(IScheduler, TState, TimeSpan, Func<TState, TState>)
    Scheduler.SchedulePeriodic<TState>(IScheduler, TState, TimeSpan, Action<TState>)
    Scheduler.SchedulePeriodic(IScheduler, TimeSpan, Action)
    Scheduler.StartStopwatch(IScheduler)
    Scheduler.AsLongRunning(IScheduler)
    Scheduler.AsStopwatchProvider(IScheduler)
    Scheduler.AsPeriodic(IScheduler)
    Scheduler.Schedule(IScheduler, Action<Action>)
    Scheduler.Schedule<TState>(IScheduler, TState, Action<TState, Action<TState>>)
    Scheduler.Schedule(IScheduler, TimeSpan, Action<Action<TimeSpan>>)
    Scheduler.Schedule<TState>(IScheduler, TState, TimeSpan, Action<TState, Action<TState, TimeSpan>>)
    Scheduler.Schedule(IScheduler, DateTimeOffset, Action<Action<DateTimeOffset>>)
    Scheduler.Schedule<TState>(IScheduler, TState, DateTimeOffset, Action<TState, Action<TState, DateTimeOffset>>)
    Scheduler.Schedule(IScheduler, Action)
    Scheduler.Schedule(IScheduler, TimeSpan, Action)
    Scheduler.Schedule(IScheduler, DateTimeOffset, Action)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX