Posts

Showing posts from May, 2018

Building a schedule manager with Quartz

Contents Introduction Prerequisites Schedule manager Putting it all together Introduction Create simple schedule manager using Quartz library ( https://www.quartz-scheduler.net/ ) Prerequisites IDE: Microsoft Visual Studio or Visual Studio Code NuGet packages: https://www.nuget.org/packages/Quartz/3.0.5 https://www.nuget.org/packages/log4net/2.0.8 Schedule manager The schedule manager allows you to: start the schedule manager suspend jobs firing for the schedule manager stop the schedule manager schedule a job (CRON trigger + timezone or Quartz trigger) unschedule a job run a job on demand Usage: ScheduleManager.Instance.Start(); // schedule an every 15 seconds test job ScheduleManager.Instance.ScheduleJob<TestJob>( "testJob" , "testGroup" , "0/15 * * * * ?" ); // some sleep to show what's happening Task.Delay(TimeSpan.FromSeconds(60)).Wait(); ScheduleManager.Instance.Stop(); Putt...