protected override void DoProcessing()
        {
			try {
				IList<string> transactionIds = GetAllUnprocessedTransactionIds();
				if ( !CollectionUtils.IsNullOrEmpty(transactionIds) ) {
					LOG.Debug("Got {0} transactions with documents", transactionIds.Count.ToString());
					List<IBlockingQueueServerWorker> workers = new List<IBlockingQueueServerWorker>();
					foreach (string transactionId in transactionIds) {
						LOG.Debug("Queued {0} transaction", transactionId.ToString());
						workers.Add(GetWorkerForTransaction(transactionId));
					}
					// Enqueue the workers to process the documents in each transaction
					ThreadQueueServer.Enqueue(workers);
				}
			}
			catch(Exception e) {
				LOG.Error("DoProcessing() threw an exception.", e);
			}
        }
Ejemplo n.º 2
0
 protected override void DoProcessing()
 {
     try
     {
         IList <string> scheduledItems = _scheduleManager.GetNextScheduledItemsToProcess();
         if (!CollectionUtils.IsNullOrEmpty(scheduledItems))
         {
             LOG.Debug("Got {0} scheduled items to run", scheduledItems.Count.ToString());
             List <IBlockingQueueServerWorker> workers = new List <IBlockingQueueServerWorker>();
             foreach (string scheduledItemId in scheduledItems)
             {
                 LOG.Debug("Queued {0} scheduled item", scheduledItemId.ToString());
                 workers.Add(new ScheduledItemProcessor(scheduledItemId, this));
             }
             // Enqueue the workers to process the documents in each transaction
             ThreadQueueServer.Enqueue(workers);
         }
     }
     catch (Exception e)
     {
         LOG.Error("DoProcessing() threw an exception.", e);
     }
 }
Ejemplo n.º 3
0
        protected override void DoStart()
        {
            try
            {
                // Start thread queue server
                if (!ThreadQueueServer.IsStarted)
                {
                    ThreadQueueServer.Run(_maxNumConcurrentThreads, false);
                }

                // Start processor threads
                foreach (INodeProcessor processor in Processors)
                {
                    processor.Start();
                }
            }
            catch (Exception e)
            {
                LOG.Error("DoStart() threw an exception.", e);
                DoStop();
                throw;
            }
        }