Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

#JobManager

This is a little JobManager in c#.

Library

Newtonsoft Json for the json parsing.

How to use

Example, you want to write Hello every minute:

usingJobManager;usingJobManager.Date;usingSystem;publicclassHello{publicintJMExecute(){Console.WriteLine("Hello World!");return1;}}publicclassTestJob{publicstaticvoidMain(String[]args){// Job CreationDateTimedt=DateTime.Now;DateIntervaldi=newDateInterval();di.Minutes=1;Jobj=newRepeatableJob("HelloJob1",newHello(),dt,di);// Manager Creation// Tick every 30 secondsManagerm=newManager("path/to/json/save/file","path/to/log/file",30000);m.AddJob(j);}}

The manager automatically save as a json structure every information needed to a job. It will reload a job if it already exists in the json file given.

Example with the json structure given by the code above :

[
{
"Name": "RepeatableJob",
"Id" : "HelloJob1",
"ExecutionDate" : ...insert current date here..."ExecutionInterval" : {
"Years" : 0,
"Months" : 0,
"Days" : 0,
"Hours" : 0,
"Minutes" : 1,
"Seconds" : 0,
"Milliseconds" : 0
}
}
]

About

Job Manager in C#

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages