void RemoveFromPending(QueueItem item)
 {
     lock (_pending)
         _pending.Remove(item);
 }
 void Consume(QueueItem item)
 {
     try
     {
         log.InfoFormat("Consumindo item {0}", item.Id);
         item.Executed = DateTime.Now;
         _queueItemController.Update(item);
     }
     catch (Exception ex)
     {
         log.Error(string.Format("Erro durante a execução do item {0}", item.Id), ex);
         PutOnPending(item);
     }
     finally
     {
         RemoveFromExecuting(item);
         _event.Set();
     }
 }
 void RemoveFromExecuting(QueueItem item)
 {
     lock (_executing)
         _executing.Remove(item);
 }
 void PutOnPending(QueueItem item)
 {
     lock (_pending)
         _pending.Add(item);
 }
 void PutOnExecuting(QueueItem item)
 {
     lock (_executing)
         _executing.Add(item);
 }
 public void Update(QueueItem obj)
 {
     throw new NotImplementedException();
 }
 public void Insert(QueueItem obj)
 {
     throw new NotImplementedException();
 }