v9.8.2018.0605   由DataReader直接映射实体列表,以支持netstandard的MySql和SQLite,且提升性能
大石头 authored at 2018-06-05 00:45:23
1.23 KiB
X
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NewLife.Log;
using NewLife.Model;
using NewLife.Queue.Broker;
using NewLife.Queue.Scheduling;
using NewLife.Queue.Storage.FileNamingStrategies;

namespace NewLife.Queue
{
    class QueueService
    {
        #region 当前静态服务容器
        /// <summary>当前对象容器</summary>
        public static IObjectContainer Container => ObjectContainer.Current;

        #endregion

        static QueueService()
        {
            var container = Container;
            container.Register<ILog, ConsoleLog>()
                .AutoRegister<IScheduleService, ScheduleService>()
                .AutoRegister<IFileNamingStrategy, DefaultFileNamingStrategy>()
                .AutoRegister<IMessageStore, DefaultFileNamingStrategy>();

            
        }


        #region 使用
        /// <summary>日志</summary>
        /// <returns></returns>
        public static ILog Log => Container.Resolve<ILog>();


        /// <summary>计划服务</summary>
        /// <returns></returns>
        public static IScheduleService ScheduleService => Container.ResolveInstance<IScheduleService>();

        #endregion
    }
}