コード例 #1
0
ファイル: Admin.asmx.cs プロジェクト: maddya/web-crawler
 public string StopCrawler()
 {
     StopQueue  = CloudConfiguration.GetStopQueue();
     StateQueue = CloudConfiguration.GetStateQueue();
     if (StopQueue.PeekMessage() == null)
     {
         CloudQueueMessage stopSignal = new CloudQueueMessage("stop");
         StopQueue.AddMessage(stopSignal);
         if (StateQueue.PeekMessage() != null)
         {
             StateQueue.DeleteMessage(StateQueue.GetMessage());
         }
         CloudQueueMessage state = new CloudQueueMessage("Idle");
         StateQueue.AddMessage(state);
     }
     return("stopped crawling");
 }