diff --git a/AntJob.Agent/Program.cs b/AntJob.Agent/Program.cs
index 654b733..b57a3b4 100644
--- a/AntJob.Agent/Program.cs
+++ b/AntJob.Agent/Program.cs
@@ -31,7 +31,7 @@ namespace AntJob.Agent
/// </remarks>
protected override void StartWork(String reason)
{
- var set = Setting.Current;
+ var set = AntSetting.Current;
// 实例化调度器
var sc = new Scheduler();
diff --git a/AntJob/Setting.cs b/AntJob/AntSetting.cs
similarity index 97%
rename from AntJob/Setting.cs
rename to AntJob/AntSetting.cs
index c293b1d..58dce5d 100644
--- a/AntJob/Setting.cs
+++ b/AntJob/AntSetting.cs
@@ -7,7 +7,7 @@ namespace AntJob
{
/// <summary>蚂蚁配置。主要用于网络型调度系统</summary>
[Config("Ant")]
- public class Setting : Config<Setting>
+ public class AntSetting : Config<AntSetting>
{
#region 属性
/// <summary>调试开关。默认false</summary>
diff --git a/AntJob/Providers/AntClient.cs b/AntJob/Providers/AntClient.cs
index 80743a7..7abe821 100644
--- a/AntJob/Providers/AntClient.cs
+++ b/AntJob/Providers/AntClient.cs
@@ -91,7 +91,7 @@ namespace AntJob.Providers
var rs = await base.InvokeWithClientAsync<IDictionary<String, Object>>(client, "Login", arg);
- var set = Setting.Current;
+ var set = AntSetting.Current;
if (set.Debug) XTrace.WriteLine("登录{0}成功!{1}", client, rs.ToJson());
// 保存下发密钥
diff --git a/Samples/HelloWork/Program.cs b/Samples/HelloWork/Program.cs
index be081e0..bbe69f3 100644
--- a/Samples/HelloWork/Program.cs
+++ b/Samples/HelloWork/Program.cs
@@ -11,7 +11,7 @@ namespace HelloWork
{
XTrace.UseConsole();
- var set = Setting.Current;
+ var set = AntSetting.Current;
// 实例化调度器
var sc = new Scheduler();
diff --git a/Samples/HisAgent/HelloJob.cs b/Samples/HisAgent/HelloJob.cs
new file mode 100644
index 0000000..f5abe11
--- /dev/null
+++ b/Samples/HisAgent/HelloJob.cs
@@ -0,0 +1,26 @@
+using System;
+using AntJob;
+
+namespace HisAgent
+{
+ 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/HisAgent/HisAgent.csproj b/Samples/HisAgent/HisAgent.csproj
new file mode 100644
index 0000000..63e3177
--- /dev/null
+++ b/Samples/HisAgent/HisAgent.csproj
@@ -0,0 +1,16 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp3.1</TargetFramework>
+ <AssemblyVersion>1.0.*</AssemblyVersion>
+ <Deterministic>false</Deterministic>
+ <OutputPath>..\..\Bin\HisAgent</OutputPath>
+ <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\AntJob\AntJob.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/Samples/HisAgent/Program.cs b/Samples/HisAgent/Program.cs
new file mode 100644
index 0000000..f480b14
--- /dev/null
+++ b/Samples/HisAgent/Program.cs
@@ -0,0 +1,37 @@
+using System;
+using AntJob;
+using AntJob.Providers;
+using NewLife.Log;
+
+namespace HisAgent
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ XTrace.UseConsole();
+
+ var set = AntSetting.Current;
+
+ // 实例化调度器
+ var sc = new Scheduler();
+
+ // 使用分布式调度引擎替换默认的本地文件调度
+ sc.Provider = new NetworkJobProvider
+ {
+ Server = set.Server,
+ AppID = set.AppID,
+ Secret = set.Secret,
+ };
+
+ // 添加作业处理器
+ sc.Handlers.Add(new HelloJob());
+
+ // 启动调度引擎,调度器内部多线程处理
+ sc.Start();
+
+ Console.WriteLine("OK!");
+ Console.ReadKey();
+ }
+ }
+}
diff --git "a/\350\232\202\350\232\201.sln" "b/\350\232\202\350\232\201.sln"
index 0c6123f..87ae41e 100644
--- "a/\350\232\202\350\232\201.sln"
+++ "b/\350\232\202\350\232\201.sln"
@@ -22,14 +22,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntJob.Extensions", "AntJob
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E842807F-C45E-44DA-8AAE-7915C1EBF2A2}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWork", "Samples\HelloWork\HelloWork.csproj", "{5E610811-2352-4882-ADD2-87222CCDE807}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWork", "Samples\HelloWork\HelloWork.csproj", "{5E610811-2352-4882-ADD2-87222CCDE807}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A1EF271C-AEA8-4EA3-A76F-906B4D4A9058}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AntJob.Agent", "AntJob.Agent\AntJob.Agent.csproj", "{0970FDBA-2331-4600-8DD5-A37B41AF989F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntJob.Agent", "AntJob.Agent\AntJob.Agent.csproj", "{0970FDBA-2331-4600-8DD5-A37B41AF989F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HisAgent", "Samples\HisAgent\HisAgent.csproj", "{E62006DC-E61B-42B0-A06B-ED5BF3F73D9E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -69,12 +71,17 @@ Global
{0970FDBA-2331-4600-8DD5-A37B41AF989F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0970FDBA-2331-4600-8DD5-A37B41AF989F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0970FDBA-2331-4600-8DD5-A37B41AF989F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E62006DC-E61B-42B0-A06B-ED5BF3F73D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E62006DC-E61B-42B0-A06B-ED5BF3F73D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E62006DC-E61B-42B0-A06B-ED5BF3F73D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E62006DC-E61B-42B0-A06B-ED5BF3F73D9E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5E610811-2352-4882-ADD2-87222CCDE807} = {E842807F-C45E-44DA-8AAE-7915C1EBF2A2}
+ {E62006DC-E61B-42B0-A06B-ED5BF3F73D9E} = {E842807F-C45E-44DA-8AAE-7915C1EBF2A2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9337283C-C795-479F-A2F1-C892EBE2490C}