﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Autofac.Extras.Common.Tasks
{
    /// <summary>
    /// 任务配置
    /// </summary>
    public class TaskConfig
    {
        public String Id { get; set; }

        /// <summary>
        /// 任务执行间隔
        /// </summary>
        public long Interval { get; set; }

        /// <summary>
        /// 任务实现类的 Type
        /// </summary>
        public Type TaskImplementType { get; set; }

        /// <summary>
        /// 任务完成标志
        /// </summary>
        public ManualResetEvent DoneEvent { get; set; }

        public void generateTaskId()
        {
            Id = $"{nameof(TaskImplementType)}.{Guid.NewGuid()}";
        }
    }
}
