public void ShouldBeAbleToScheduleAndRunJobs() { var scheduler = FastJobs.CreateScheduler(); scheduler.Schedule <TestJob>(TimeSpan.FromSeconds(5)); using (FastJobs.Run(scheduler)) { Thread.Sleep(1000); } Assert.AreEqual(1, TestJob.Invokations); }
public static void Run(string[] args) { var scheduler = FastJobs.CreateScheduler(); scheduler.Schedule <ConsoleWriteTestJob>(TimeSpan.FromSeconds(5)); var otherScheduler = FastJobs.CreateScheduler(); otherScheduler.Schedule <OtherConsoleWriteTestJob>(TimeSpan.FromSeconds(1)); using (FastJobs.Run(scheduler)) using (FastJobs.Run(otherScheduler)) { Console.ReadKey(true); } }
public JobStartup(IFastJobScheduler scheduler) { this.scheduler = scheduler; this.disposable = FastJobs.Run(scheduler); }