Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Usage (with container):
- var container = new WindsorContainer();
- container.Register(Component.For<TestJob>(), Component.For<TestJob2>());
- ISchedulerFactory factory = new DefaultSchedulerFactory();
- var scheduler = factory
- .UseContainer(() => new WindsorServiceLocator(container))
- .Create();
- scheduler.Setup(
- Job.Run<TestJob>(x => x.RunJob()).Every(1.Second()),
- Job.Run<TestJob2>(x => x.RunJob()).Every(10.Seconds())
- ).Start();
- //Usage (without container, providing instance):
- var testJob = new TestJob2();
- var scheduler = new DefaultSchedulerFactory().Create();
- scheduler.Setup(
- Job.Run(testJob.RunJob).Every(10.Minutes())
- ).Start();
- //Usage (without container, letting Khronos create instance):
- var scheduler = new DefaultSchedulerFactory().Create();
- scheduler.Setup(
- Job.Run<TestJob>(x => x.RunJob()).Every(2.Hours())
- ).Start();
Add Comment
Please, Sign In to add comment