Sundial is a .NET full-featured open source distributed job scheduling system that can be used from the smallest application to large enterprise systems.
characteristic
- Simplify scheduling jobs
- Support Job Monitor
- Support job executor
- Support for custom job storage components (persistence)
- Support custom policy execution
- Built-in cycle, cron job
- Support for custom job triggers
- Support dependency injection control (including HTTP control support)
- High cohesion, low coupling, making the code simpler
- very small, only
41KB
- No third party dependence
- available at
Windows/Linux/MacOS
Daemon deployment - Support distributed, cluster (multi-instance) deployment
- Support load balancing (based on TCP/IP)
- High quality code and good unit tests
- Cross-platform, support .NET5+
Install
dotnet add package Sundial
quick start
we are athome pageThere are quite a few examples out there, this is the first to get you started:
- Define jobs and implement
IJob
interface:
public class MyJob : IJob { private readonly ILogger<MyJob> _logger; public MyJob(ILogger<MyJob> logger) { _logger = logger; } public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken) { _logger.LogInformation($"{context.JobDetail} {context.Trigger} {context.OccurrenceTime}"); await Task.CompletedTask; } }
- exist
Startup.cs
registerAddSchedule
Services and jobs:
services.AddSchedule(options => { options.AddJob<MyJob>(Triggers.PeriodSeconds(5) , Triggers.Minutely()); });
- Run the project:
info: System.Logging.ScheduleService[0] Schedule Hosted Service is running. warn: System.Logging.ScheduleService[0] Schedule Hosted Service cancels hibernation and GC.Collect(). info: System.Logging.ScheduleService[0] The Scheduler of <job1> successfully updated to the schedule. info: Sundial.Samples.MyJob[0] <job1> <job1 job1_trigger2> 5000ms 2022/11/23 16:22:51 info: Sundial.Samples.MyJob[0] <job1> <job1 job1_trigger2> 5000ms 2022/11/23 16:22:56 info: Sundial.Samples.MyJob[0] <job1> <job1 job1_trigger3> * * * * * 2022/11/23 16:23:00 info: Sundial.Samples.MyJob[0] <job1> <job1 job1_trigger2> 5000ms 2022/11/23 16:23:01 info: Sundial.Samples.MyJob[0] <job1> <job1 job1_trigger2> 5000ms 2022/11/23 16:23:07
document
You can findhome pageFind the Sundial documentation.
contribute
The main purpose of this repository is to continue to evolve the Sundial core, making it faster and easier to use. Sundial was developed in Gitee is open to the public, and we thank the community for contributing bug fixes and improvements.
license
Sundial uses MIT Open source license.
MIT License Copyright (c) 2020-2022 百小僧, Baiqian Co.,Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#SundialNET #Homepage #Documentation #Download #Distributed #Job #Scheduling #System #News Fast Delivery