Exemplo n.º 1
0
        public ActionResult Stop()
        {
            Control control = new Control()
            {
                Stop = true
            };

            BusHost.Publish<Control>(control, BusTopic.Control);
            return RedirectToAction("Index", "Admin");
        }
Exemplo n.º 2
0
        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();
                }
            });
        }