Esempio n. 1
0
        private void Index(IndexAction action)
        {
            switch (action.Action)
            {
            case Action.Insert:
                Insert(action.Record);
                break;

            case Action.Update:
                Delete(action.Record);
                Insert(action.Record);
                break;

            case Action.Delete:
                Delete(action.Record);
                break;
            }
        }
Esempio n. 2
0
 private void Enqueue(IndexAction action)
 {
     lock (syncObj)
     {
         if (!worker.IsAlive)
         {
             worker = new Thread(new ThreadStart(BackgroundIndexer));
             worker.Start();
         }
     }
     if ((m_queue.Count > Settings.Instance.MaxQueueSize))
     {
         GXLogging.Debug(log, "Indexer Enqueue waiting...");
     }
     while (m_queue.Count > Settings.Instance.MaxQueueSize)
     {
         Thread.Sleep(50);
     }
     m_queue.Enqueue(action);
 }