

namespace HuanMeng.DotNetCore.Processors
{
    /// <summary>
    /// 任务处理器
    /// </summary>
    public abstract class BaseProcessor : ITaskProcessor
    {
        /// <summary>
        /// 终止内部处理线程的最长等待时间(毫秒)
        /// </summary>
        protected const int WaitTimeMax_StopProc = 20000;


        /// <summary>
        /// 构造函数
        /// </summary>
        public BaseProcessor()
        {
            //加载配置
            LoadSettings();
        }

        /// <summary>
        /// 加载配置
        /// </summary>
        protected virtual void LoadSettings()
        {
            //初始化
            //  LogHelper.Info("BaseProcessor.LoadSettings");
        }

        /// <summary>
        /// Dispose
        /// </summary>
        public virtual void Dispose()
        {
        }

        /// <summary>
        /// 执行任务
        /// </summary>
        public virtual void Run()
        {
            //LogHelper.Info("BaseProcessor.Run");
        }

        /// <summary>
        /// 停止执行任务
        /// </summary>
        public virtual void Stop()
        {
            // LogHelper.Info("BaseProcessor.Stop");
        }
    }

}
