Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leosperry/Chroniton
A library for running tasks(jobs) on schedules.
https://github.com/leosperry/Chroniton
Last synced: about 1 month ago
JSON representation
A library for running tasks(jobs) on schedules.
- Host: GitHub
- URL: https://github.com/leosperry/Chroniton
- Owner: leosperry
- License: mit
- Created: 2016-06-10T21:02:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-23T19:55:27.000Z (over 7 years ago)
- Last Synced: 2024-04-30T18:21:18.601Z (about 1 month ago)
- Language: C#
- Homepage:
- Size: 106 KB
- Stars: 180
- Watchers: 14
- Forks: 18
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Lists
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awsome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core - Chroniton.NetCore - 用于在日程安排上运行任务(作业)的轻量级健壮库。 (框架, 库和工具 / 任务计划)
- awesome - leosperry/Chroniton - A library for running tasks(jobs) on schedules. (C\#)
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dot-dev - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-csharp - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core-master - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-cn - Chroniton - 简单、完全集成、可自定义的库,用于按计划进行强类型的任务。 (计划调度)
- awesome-dotnet - Chroniton - A simple, fully integrable, and customizable library for running strongly typed jobs (tasks) on schedules. (Scheduling)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- awesome-dotnet-core - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Frameworks, Libraries and Tools / Scheduler and Job)
- system-architecture-awesome - Chroniton.NetCore - Lightweight robust library for running tasks(jobs) on schedules. (Scheduler and Job)
README
[![Build status](https://ci.appveyor.com/api/projects/status/8n8pllu27cihbsx8/branch/master?svg=true)](https://ci.appveyor.com/project/leosperry/chroniton/branch/master)
[![NuGet](https://img.shields.io/nuget/v/Chroniton.svg)](https://www.nuget.org/packages/Chroniton/)## Synopsis
A library for running tasks(jobs) on schedules. It supports:
* Strongly typed jobs with strongly typed parameters
* Asynchronous execution
* Running a single job on multiple schedules
* Running Multiple jobs on a single schedule
* Cron schedules
* Run once and expiring schedules
* Custom schedules
* Limiting the number of threads on which work is done
* Managing behaviors of jobs which run beyond their next scheduled time
* Dependency Injection initialization
* Full mocking for unit tests
* .NET Core
See [Wiki](https://github.com/leosperry/Chroniton/wiki) and [Tutorial](https://github.com/leosperry/Chroniton/wiki/Tutorial) for more info. Official site [here](http://chroniton.net/).## Code Example
```C#
var singularity = Singularity.Instance;var job = new SimpleParameterizedJob((parameter, scheduledTime) =>
Console.WriteLine($"{parameter}\tscheduled: {scheduledTime.ToString("o")}"));var schedule = new EveryXTimeSchedule(TimeSpan.FromSeconds(1));
var scheduledJob = singularity.ScheduleParameterizedJob(
schedule, job, "Hello World", true); //starts immediatelyvar startTime = DateTime.UtcNow.Add(TimeSpan.FromSeconds(5));
var scheduledJob2 = singularity.ScheduleParameterizedJob(
schedule, job, "Hello World 2", startTime);singularity.Start();
Thread.Sleep(10 * 1000);
singularity.StopScheduledJob(scheduledJob);
Thread.Sleep(5 * 1000);
singularity.Stop();
```
In the above example, here's what happens:
The first job starts immediately and print's "Hello World" once every second.
Five seconds later the second job starts and prints "Hello World2" every second.
Five seconds later the first job stops and only the second job is running.
Five seconds later, `Stop()` is called and the second job also stops.
Notice the same job is used with multiple schedules with different parameters.## Coming Soon !!!
The above code works with the currently released version. A new version with serialization features is on the way and has been started. There will be some breaking changes. If you'd like to see some of the changes coming, check out the [Serialization branch](https://github.com/leosperry/Chroniton/tree/Serialize). The core logic for how jobs run will not change, but how jobs get added has. I'm personally very excited to be bringing these changes as it opens up a world of possibilites for the project.
## Motivation
This project was inspired for the need to have a strongly typed .NET solution for running tasks on schedules.
## Installation
in your nuget package manager:
`Install-Package Chroniton`
for .NET Core use:
`Install-Package Chroniton.NetCore`
## Contributors
Created by : Leonard Sperry
[email protected]## License
Licensed under the MIT License
## Changes
### V 1.0.3
* Cron string support
* XUnit
* Simplified constructors for SimpleJob and SimpleParameterizedJob### V 1.0.2
* Support for run once and expiring jobs### V 1.0.1
* Simplified Singularity by removing one of the main loops.
* Added .NET Core support## Future Features
* Serialization
* Distributed execution## Notes
Unfortunately, .NET Core projects do not yet support referencing Shared Code projects. Therefore, the .NET Core projects in this solution reference all the files in the shared projects directly.