Example #1
0
 /// <summary>
 /// Registers/Adds work to the <see cref="CrawlerWorkSource"/>.
 /// </summary>
 /// <param name="work"><see cref="ICrawlerWork"/></param>
 public void RegisterWork(IWork work)
 {
     if (work.IsReadyToStart())
     {
         availableWork.Enqueue(work);
     }
     else
     {
         workSourceScheduler.ScheduleWork(work);
     }
 }
Example #2
0
 /// <summary>
 /// Registers/Adds work to the <see cref="CrawlerWorkSource"/>.
 /// </summary>
 /// <param name="work"><see cref="ICrawlerWork"/></param>
 public void RegisterWork(IWork work)
 {
     if (work.IsReadyToStart())
     {
         availableWork.Enqueue(work);
     }
     else
     {
         workSourceScheduler.ScheduleWork(work);
     }
 }
Example #3
0
 /// <summary>
 /// Returns <see cref="ICrawlerWork"/> to the current <see cref="CrawlerWorkSource"/> for rescheduling.
 /// </summary>
 /// <param name="work"></param>
 public void ReturnFinishedWork(IWork work)
 {
     if (!IsSourceReleased)
     {
         if (work.IsReadyToStart())
         {
             availableWork.Enqueue(work);
             NotifyFreeCrawler();
         }
         else
         {
             workSourceScheduler.ScheduleWork(work);
         }
     }
 }
Example #4
0
 /// <summary>
 /// Returns <see cref="ICrawlerWork"/> to the current <see cref="CrawlerWorkSource"/> for rescheduling.
 /// </summary>
 /// <param name="work"></param>
 public void ReturnFinishedWork(IWork work)
 {
     if (!IsSourceReleased)
     {
         if (work.IsReadyToStart())
         {
             availableWork.Enqueue(work);
             NotifyFreeCrawler();
         }
         else
         {
             workSourceScheduler.ScheduleWork(work);
         }
     }
 }