AntJob/Samples/HelloWork/HelloJob.cs

26 lines
593 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using AntJob;
namespace HelloWork
{
internal class HelloJob : Handler
{
public HelloJob()
{
// 今天零点开始每10秒一次
var job = Job;
job.Start = DateTime.Today;
job.Step = 10;
}
protected override Int32 Execute(JobContext ctx)
{
// 当前任务时间
var time = ctx.Task.Start;
WriteLog("新生命蚂蚁调度系统!当前任务时间:{0}", time);
// 成功处理数据量
return 1;
}
}
}