<PackageReference Include="System.Reactive" Version="6.0.1" />

ScheduledItem<TAbsolute>

public abstract class ScheduledItem<TAbsolute> : IScheduledItem<TAbsolute>, IComparable<ScheduledItem<TAbsolute>>, IDisposable where TAbsolute : IComparable<TAbsolute>
Abstract base class for scheduled work items.
public TAbsolute DueTime { get; }

Gets the absolute time at which the item is due for invocation.

public bool IsCanceled { get; }

Gets whether the work item has received a cancellation request.

protected ScheduledItem(TAbsolute dueTime, IComparer<TAbsolute> comparer)

Creates a new scheduled work item to run at the specified time.

public static bool op_Equality(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether two specified ScheduledItem<T, U> objects are equal.

public static bool op_GreaterThan(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether one specified ScheduledItem<T> object is due after a second specified ScheduledItem<T> object.

public static bool op_GreaterThanOrEqual(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether one specified ScheduledItem<T> object is due after or at the same time of a second specified ScheduledItem<T> object.

public static bool op_Inequality(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether two specified ScheduledItem<T, U> objects are inequal.

public static bool op_LessThan(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether one specified ScheduledItem<T> object is due before a second specified ScheduledItem<T> object.

public static bool op_LessThanOrEqual(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)

Determines whether one specified ScheduledItem<T> object is due before or at the same of a second specified ScheduledItem<T> object.

public void Cancel()

Cancels the work item by disposing the resource returned by InvokeCore as soon as possible.

public int CompareTo(ScheduledItem<TAbsolute> other)

Compares the work item with another work item based on absolute time values.

public void Invoke()

Invokes the work item.

protected abstract IDisposable InvokeCore()

Implement this method to perform the work item invocation, returning a disposable object for deep cancellation.