示例#1
0
文件: Program.cs 项目: nokitty/play
        static void Main(string[] args)
        {
            var worker = new Worker();

            //添加新工作
            worker.Add(new Job1(TimeSpan.FromSeconds(1), "job1"));
            worker.Add(new Job1(TimeSpan.FromSeconds(2), "job2"));
            worker.Add(new Job1(TimeSpan.FromSeconds(3), "job3"));
            worker.Add(new Job3());

            worker.StartAsync();
        }
示例#2
0
文件: Job3.cs 项目: nokitty/play
 public override void Excute(object param)
 {
     var worker = new Worker();
     worker.Add(new Job1(TimeSpan.Zero, "sub worker job1"));
     worker.Start();
 }