-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScheduledAction.cs
41 lines (35 loc) · 1.33 KB
/
ScheduledAction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Abyssal.Common
{
/// <summary>
/// Represents an action that has been scheduled for execution by an <see cref="ActionScheduler"/>.
/// </summary>
public class ScheduledAction
{
/// <summary>
/// The <see cref="DateTimeOffset"/> at which this action will execute.
/// </summary>
public DateTimeOffset Time { get; internal set; }
/// <summary>
/// The callback to be executed when this action is executed.
/// </summary>
public Func<Task> Action { get; internal set; }
/// <summary>
/// The <see cref="Task"/> representing the delay until execution.
/// </summary>
public Task Delay { get; internal set; }
/// <summary>
/// The <see cref="CancellationTokenSource"/> controlling the cancellation of this <see cref="ScheduledAction"/>.
/// </summary>
public CancellationTokenSource CancellationTokenSource { get; internal set; }
/// <summary>
/// The <see cref="ActionScheduler"/> that scheduled this <see cref="ScheduledAction"/>.
/// </summary>
public ActionScheduler Scheduler { get; internal set; }
internal ScheduledAction()
{
}
}
}