当前位置:网站首页>Using quartz under. Net core -- preliminary understanding of [2] operations and triggers
Using quartz under. Net core -- preliminary understanding of [2] operations and triggers
2022-04-23 17:10:00 【Tomato Warrior】
Catalog
2、 What is? Quartz Homework in
In the last one , We implemented a simple job scheduling , Next, we will have a preliminary understanding of Quartz Homework in (Job)
1、 Key interfaces and classes
IScheduler- The main way to interact with the scheduler API.IJob- The interface implemented by the component you want the scheduler to execute .IJobDetail- Used for definition Jobs Example .ITrigger- A component that defines a schedule that will execute a given job , The job can have multiple associated triggersJobBuilder- Used for definition / structure JobDetail example , This instance defines Jobs Example .TriggerBuilder- Used for definition / Instance building triggers .SchedulerBuilder- Used for definition / Build scheduler instance , need Quartz 3.1 Or later .
The above part is directly excerpted from the official website , Before you know the job , Let's familiarize ourselves with the above interfaces and classes , This is very helpful for the next study
2、 What is? Quartz Homework in
The job is to realize IJob The class of the interface , The interface has only one simple method :
namespace Quartz
{
public interface IJob
{
Task Execute(JobExecutionContext context);
}
}
Review our custom in the last article HelloJob, We did IJob Interface , And realize the unique Execute Method , That's it .
public class HelloJob : IJob
{
public async Task Execute(IJobExecutionContext context)
{
await Console.Out.WriteLineAsync($"{DateTime.Now}");
}
}
3、 Job execution context
Execure In the method , Conveys a parameter ,IJobExecutionContext context
JobExecutionContext Contained in the “ Runtime ” Information about the environment - Handle to the scheduler executing the job , Handle to trigger execution , Operational JobDetail object , And some other projects .
4、 Job unique ID
Review the code when creating the job in the previous section
IJobDetail job = JobBuilder.Create<HelloJob>()
.WithIdentity("job1", "jobGroup1")
.Build();
Here we name our homework job1, And assigned to jobGroup1 Group , Then the only identification of the job is separated by dots "jobGroup1.job1"
The same is true for triggers
版权声明
本文为[Tomato Warrior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230553457897.html
边栏推荐
- Conversion between hexadecimal numbers
- _ Mold_ Board_
- Paging the list collection
- RPC核心概念理解
- org. apache. parquet. schema. InvalidSchemaException: A group type can not be empty. Parquet does not su
- Grpc gateway based on Ocelot
- Collect blog posts
- Clickhouse SQL operation
- Shell脚本——Shell编程规范及变量
- PHP efficiently reads large files and processes data
猜你喜欢
![[pimf] openharmony paper Club - what is the experience of wandering in ACM survey](/img/b6/3df53baafb9aad3024d10cf9b56230.png)
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey

STM32__ 03 - beginner timer

Detailed explanation of Niuke - Gloves

Milvus 2.0 détails du système d'assurance de la qualité

1-4 configuration executable script of nodejs installation

Idea of batch manufacturing test data, with source code

ASP. Net core dependency injection service life cycle

Milvus 2.0 質量保障系統詳解

Getting started with JDBC

Sub database and sub table & shardingsphere
随机推荐
Change the password after installing MySQL in Linux
org. apache. parquet. schema. InvalidSchemaException: A group type can not be empty. Parquet does not su
Talk about browser cache control
Nifi fast installation and file synchronization
Getting started with JDBC
Promise (IV)
Shell-awk命令的使用
Use between nodejs modules
Paging the list collection
Clickhouse table engine
freeCodeCamp----prob_ Calculator exercise
Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
Production environment——
Go language, array, string, slice
RTKLIB 2.4.3源码笔记
An essay on the classical "tear down the wall in thinking"
SQL database
About stream flow, write it down briefly------
ClickHouse-表引擎
PHP efficiently reads large files and processes data