Hanson.Common.ScheduleUtils
2.0.0
dotnet add package Hanson.Common.ScheduleUtils --version 2.0.0
NuGet\Install-Package Hanson.Common.ScheduleUtils -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hanson.Common.ScheduleUtils" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hanson.Common.ScheduleUtils --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Hanson.Common.ScheduleUtils, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hanson.Common.ScheduleUtils as a Cake Addin #addin nuget:?package=Hanson.Common.ScheduleUtils&version=2.0.0 // Install Hanson.Common.ScheduleUtils as a Cake Tool #tool nuget:?package=Hanson.Common.ScheduleUtils&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
README
Hanson.Common.ScheduleUtils
主要功能
- 提供排程觸發事件功能
- 指定排程及是否重複執行
- 設定 Schedule 執行程式
- 啟動 Schedule
前置條件
- 開發環境需具備 .Net 8.0
- 運行於 Windows Platform (x64)
- 運行於 Linux Platform (x64)
- 運行於 Raspberry PI Platform (x64)
安裝方式
- 採用 Nuget 方式進行安裝作業 https://www.nuget.org/packages/Hanson.Common.ScheduleUtils/
授權
此專案採用的 License為 Apache-2.0
使用範例
命名空間
using Hanson.Common.Utils;
- 執行排程範例
public async Task RunScheduleAsync(string cronExpression)
{
CancellationTokenSource cts = new CancellationTokenSource();
string scheduleId = "schedule id";
// 每5秒執行一次
string cronExpression = @"0/5 * * * * ?";
var schedule = new JobSchedule();
await schedule.SetSchedule(scheduleId, cronExpression, () =>
{
Console.WriteLine($"{SystemTime.Now} - Trigger {scheduleId}");
});
await schedule.StartAsync(cts.Token);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Hanson.Common.Extensions (>= 2.0.1)
- Quartz (>= 3.13.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.