示例#1
0
        /// <summary>
        /// Applies discount to edges randomly every minute
        /// </summary>
        private void ApplyDiscounts()
        {
            Thread.Sleep(1000 * 60);

            while (true)
            {
                var result = _graph.ApplyDiscountRandomly();

                var response = new Response<Tuple<string, string, decimal>>(
                    result,
                    "200 OK",
                    "");

                var serialized = response.Serialize();
                _connection.Broadcast(serialized);

                Thread.Sleep(1000 * 60);
            }
        }