public ActionResult Stop() { Control control = new Control() { Stop = true }; BusHost.Publish<Control>(control, BusTopic.Control); return RedirectToAction("Index", "Admin"); }
public Task ProcessControl(Control control) { return Task.Factory.StartNew(() => { if (control.Stop) { SubscriptionHandler.Instance.Unsubscribe("GoodVote"); SubscriptionHandler.Instance.Unsubscribe("BadVote"); SubscriptionHandler.Instance.Unsubscribe("SaveVote"); } if (control.Start) { Subscribe(); } if (control.Reset && _VoteProcessor != null) { _VoteProcessor.Reset(); } }); }