Asgard.Job
3.1.9
dotnet add package Asgard.Job --version 3.1.9
NuGet\Install-Package Asgard.Job -Version 3.1.9
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="Asgard.Job" Version="3.1.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asgard.Job" Version="3.1.9" />
<PackageReference Include="Asgard.Job" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Asgard.Job --version 3.1.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Asgard.Job, 3.1.9"
#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.
#:package Asgard.Job@3.1.9
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Asgard.Job&version=3.1.9
#tool nuget:?package=Asgard.Job&version=3.1.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Asgard.Job
项目简介
Asgard.Job 是 Asgard 框架的任务调度与后台作业执行模块,支持定时任务、延迟任务、分布式调度与任务持久化,适用于微服务和分布式场景下的异步作业管理。兼容 .NET 8,并可与 Asgard 框架其他模块集成。
主要类与接口说明
JobManager:任务管理器,负责任务的注册、启动、停止及生命周期管理。JobBase:任务抽象基类,所有自定义任务需继承该类,实现Start和Stop方法。JobInfoItem:任务元数据与实例管理,内部用于存储任务构造器、类型、定时参数等信息。JobTypeEnum:任务类型枚举,支持 Singleton(单例)与 Scoped(每次执行新建)。JobTimerTypeEnum:定时类型枚举,支持 Independent(独立计时)与 Dependent(依赖上次完成)。
快速开始
在主项目中引用 Asgard.Job:
创建自定义任务:
using Asgard.Job; using Asgard.Abstract; public class MyJob : JobBase { public MyJob(AbsLogger logger) : base(logger) { } public override async Task Start(AsgardContext context) { // 任务逻辑 } public override async Task Stop(AsgardContext context) { // 停止逻辑 } }注册并启动任务:
var jobManager = new JobManager(loggerProvider); jobManager.PushNewJobInfo(typeof(MyJob)); jobManager.Start();
依赖说明
- 依赖
Asgard.Abstract模块。 - 需 .NET 8 及以上环境。
维护者
- 维护者:Asgard Framework 团队
- 联系方式:暂无(如需协助请通过主项目渠道反馈)
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Asgard.Abstract (>= 3.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.