using System; using System.Collections.Generic; using Library; using LitJson; using System.Linq; using System.Threading; using System.Text; namespace MySystem { public class SendPrizeDataService { public readonly static SendPrizeDataService Instance = new SendPrizeDataService(); private SendPrizeDataService() { } public void Start() { Thread th = new Thread(dosomething); th.IsBackground = true; th.Start(); } public void dosomething() { while (true) { string content = RedisDbconn.Instance.RPop("HaoDaPrizeDataQueue"); if (!string.IsNullOrEmpty(content)) { try { RabbitMQClient.Instance.SendPrize(content, "QUEUE_KXS_HAODA_PRIZE_CONFIG_DIVISION"); } catch (Exception ex) { Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "推送好哒奖励数据异常"); } } else { Thread.Sleep(2000); } } } } }