Exemplo n.º 1
0
        public static void Enqueue_ChangeData(string p_table_name)
        {
            CallBack_Info p_CallBack_Info = new CallBack_Info
            {
                Table_Name = p_table_name
            };

            c_queue_changeData.Enqueue(p_CallBack_Info);
        }
Exemplo n.º 2
0
        public static CallBack_Info Dequeue_ChangeData()
        {
            CallBack_Info _CallBack_Info = (CallBack_Info)c_queue_changeData.Dequeue();

            if (_CallBack_Info != null)
            {
                return(_CallBack_Info);
            }
            else
            {
                return(_CallBack_Info);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// thread chuyên load dữ liệu tĩnh khi có sự thay đổi
 /// </summary>
 private void ThreadReloadWhenChangeData()
 {
     while (true)
     {
         try
         {
             CallBack_Info _CallBack_Info = MemoryData.Dequeue_ChangeData();
             if (_CallBack_Info != null && _CallBack_Info.Table_Name != null && _CallBack_Info.Table_Name != "")
             {
                 if (_CallBack_Info.Table_Name == Table_Change.APPHEADER)
                 {
                     MemoryData.GetCacheCustomerInfo();
                 }
             }
             Thread.Sleep(1000);
         }
         catch (Exception ex)
         {
             Thread.Sleep(2000);
             Logger.Log().Error(ex.ToString());
         }
     }
 }