Exemple #1
0
        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();
        }
Exemple #2
0
 public override void Excute(object param)
 {
     var worker = new Worker();
     worker.Add(new Job1(TimeSpan.Zero, "sub worker job1"));
     worker.Start();
 }