/// <summary> /// 线程轮训服务 /// </summary> /// <param name="ws">要轮训的代码块</param> /// <param name="interval">间隔的秒数</param> /// <returns></returns> private string ThreadPoolService(Func<string> ws, Action<string> logger, params int[] interval) { string url = ws(); foreach (int i in interval) { Thread.Sleep(i * 1000); url = ws(); if (!string.IsNullOrWhiteSpace(url)) { logger(string.Format("点播轮训调用时间:{0}秒,发生的时间:{1}秒", i, DateTime.Now)); break; } } return url; }
调用WEB服务的方法
最新推荐文章于 2019-11-27 18:05:28 发布