namespace Milimoe.FunGame.Core.Interface.Base
{
public interface IScheduledTask
{
///
/// 任务名称
///
public string Name { get; }
///
/// 任务执行逻辑
///
public Action Action { get; }
///
/// 记录上一次执行时间
///
public DateTime? LastRun { get; }
///
/// 记录下一次执行时间
///
public DateTime NextRun { get; }
///
/// 任务执行时长
///
public TimeSpan ExecutedTimeSpan { get; }
///
/// 最后一次执行时发生的错误
///
public Exception? Error { get; }
///
/// 捕获异常后,触发的回调函数
///
public Action? ErrorHandler { get; }
}
}