public static void AddDefaultScheduler(this IJobbrBuilder builder, Action <DefaultSchedulerConfiguration> config) { var defaultConfig = new DefaultSchedulerConfiguration(); config(defaultConfig); builder.Add <DefaultSchedulerConfiguration>(defaultConfig); builder.Register <IPeriodicTimer>(typeof(FixedMinuteTimer)); builder.Register <IDateTimeProvider>(typeof(UtcNowTimeProvider)); builder.Register <IJobScheduler>(typeof(DefaultScheduler)); }
public DefaultScheduler(IJobbrRepository repository, IJobExecutor executor, InstantJobRunPlaner instantJobRunPlaner, ScheduledJobRunPlaner scheduledJobRunPlaner, RecurringJobRunPlaner recurringJobRunPlaner, DefaultSchedulerConfiguration configuration, IPeriodicTimer periodicTimer, IDateTimeProvider dateTimeProvider) { this.repository = repository; this.executor = executor; this.instantJobRunPlaner = instantJobRunPlaner; this.scheduledJobRunPlaner = scheduledJobRunPlaner; this.recurringJobRunPlaner = recurringJobRunPlaner; this.configuration = configuration; this.periodicTimer = periodicTimer; this.dateTimeProvider = dateTimeProvider; this.periodicTimer.Setup(this.EvaluateRecurringTriggers); }