示例#1
0
 /// <summary>
 /// 一般构造
 ///     独立运行模式使用
 /// </summary>
 /// <param name="aqiManage"></param>
 /// <param name="listSrcUrl"></param>
 /// <param name="name">名称一般同 数据源tag</param>
 public AqiRunner(AqiManage aqiManage, List <ISrcUrl> listSrcUrl, string name)
 {
     this.name      = name;
     this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action <object, ElapsedEventArgs>(this.timer_RunEvent));
     this.ias       = aqiManage.AqiSave;
     this.an        = aqiManage.AqiNote;
     this.ar        = aqiManage.AqiRetry;
     this.thisLock  = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
 }
示例#2
0
        private ReaderWriterLockSlim thisLock;                   //读写锁

        #endregion

        #region 构造

        /// <summary>
        /// 默认构造
        ///     合并运行模式使用
        /// </summary>
        /// <param name="manage"></param>
        /// <param name="listSrcUrl"></param>
        public AqiRunner(AqiManage manage, List <ISrcUrl> listSrcUrl)
        {
            this.name      = "DefaultRunner";
            this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action <object, System.Timers.ElapsedEventArgs>(this.timer_RunEvent));
            this.ias       = manage.AqiSave;
            this.an        = manage.AqiNote;
            this.ar        = manage.AqiRetry;
            this.thisLock  = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
        }
示例#3
0
        /// <summary>
        /// 添加 数据源接口
        /// </summary>
        /// <param name="dictSrcUrl">接口集合</param>
        public bool AddSrcUrl(Dictionary <string, ISrcUrl> dictSrcUrl)
        {
            //转为Timer集合
            Dictionary <string, SrcUrlGroupTimer> list = SrcUrlGroupTimer.CreateList(dictSrcUrl);

            foreach (SrcUrlGroupTimer timer in list.Values)
            {
                Add(timer);
            }

            return(true);
        }