DotNext.Threading by .NET Foundation and Contributors

<PackageReference Include="DotNext.Threading" Version="4.12.4" />

 Scheduler

public static class Scheduler
Represents timer-based scheduler.
public abstract class DelayedTask

Represents a task with delayed completion.

public abstract class DelayedTask<TResult> : DelayedTask

Represents a task with delayed completion.

Represents an exception indicating that the delayed task is canceled safely without entering the scheduled callback.

public static DelayedTask ScheduleAsync<TArgs>(Func<TArgs, CancellationToken, ValueTask> callback, TArgs args, TimeSpan delay, CancellationToken token = default)

Schedules the specific action to be execute once after the specified delay.

public static DelayedTask<TResult> ScheduleAsync<TArgs, TResult>(Func<TArgs, CancellationToken, ValueTask<TResult>> callback, TArgs args, TimeSpan delay, CancellationToken token = default)

Schedules the specific action to be execute once after the specified delay.