public ActionResult ProcessNextItem() { var store = new ItemStore(_storageLocator); new ItemProcessor().ProcessNextItem(store); return RedirectToAction("Index"); }
public void ProcessNextItem(ItemStore store) { var nextItem = store.RetrieveForProcessing(); if (nextItem != null) { var finishedItem = new ItemProcessor().ProcessItem(nextItem); store.StoreFinishedItem(finishedItem); } }
public override void Run() { while (true) { var storageLocator = new StorageManager("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"); var store = new ItemStore(storageLocator); new ItemProcessor().ProcessNextItem(store); Thread.Sleep(1000); Trace.WriteLine("Working", "Information"); } }
public ActionResult Index() { var store = new ItemStore(_storageLocator); var model = new StatusViewModel() { ProcessedItems = store.GetProcessedList(), UnprocessedItems = store.GetUnprocessedList() }; ViewData["file"] = TempData["file"]; return View(model); }