#JobManager
This is a little JobManager in c#.
Newtonsoft Json for the json parsing.
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
}
}
]