Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }