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" />
                    
Directory.Packages.props
<PackageReference Include="Asgard.Job" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Asgard.Job&version=3.1.9
                    
Install as a Cake Tool

Asgard.Job

项目简介

Asgard.Job 是 Asgard 框架的任务调度与后台作业执行模块,支持定时任务、延迟任务、分布式调度与任务持久化,适用于微服务和分布式场景下的异步作业管理。兼容 .NET 8,并可与 Asgard 框架其他模块集成。

主要类与接口说明

  • JobManager:任务管理器,负责任务的注册、启动、停止及生命周期管理。
  • JobBase:任务抽象基类,所有自定义任务需继承该类,实现 StartStop 方法。
  • JobInfoItem:任务元数据与实例管理,内部用于存储任务构造器、类型、定时参数等信息。
  • JobTypeEnum:任务类型枚举,支持 Singleton(单例)与 Scoped(每次执行新建)。
  • JobTimerTypeEnum:定时类型枚举,支持 Independent(独立计时)与 Dependent(依赖上次完成)。

快速开始

  1. 在主项目中引用 Asgard.Job:

  2. 创建自定义任务:

    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)
        {
            // 停止逻辑
        }
    }
    
  3. 注册并启动任务:

    var jobManager = new JobManager(loggerProvider);
    jobManager.PushNewJobInfo(typeof(MyJob));
    jobManager.Start();
    

依赖说明

维护者

  • 维护者:Asgard Framework 团队
  • 联系方式:暂无(如需协助请通过主项目渠道反馈)
Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.9 112 1/16/2026
3.1.8 101 1/15/2026
3.1.7 198 12/22/2025
3.1.6 446 12/11/2025
3.1.5 232 12/7/2025
3.1.4 699 12/2/2025
3.1.2 285 11/30/2025
3.1.1 289 11/30/2025