Exemplo n.º 1
0
        public void Execute(ShardingExecutionContext context, TimeSpan timeout)
        {
            Stopwatch watch = Stopwatch.StartNew();

            while (watch.Elapsed < timeout && DoExecute(context))
            {
                ;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 执行job,实际job的内容,返回true表示可以继续重复执行
 /// </summary>
 /// <param name="context">job执行上下文</param>
 /// <returns></returns>
 protected abstract bool DoExecute(ShardingExecutionContext context);