示例#1
0
        public WorkerScheduled(string queueName, int batchSize, IJobServiceScopeFactory scopeFactory, IJobLogger <WorkerScheduled> logger)
            : base(queueName, batchSize, 1, true, scopeFactory, logger)
        {
            _timeProvider = ServiceScope.GetRequiredService <ITimeProvider>();

            _timer              = ServiceScope.GetRequiredService <ITimer>();
            _timer.TimeElapsed += CheckScheduledJobs;

            _scheduledJobs    = new ConcurrentDictionary <ulong, JobInfo>();
            _periodicJobs     = new ConcurrentDictionary <string, ulong>();
            _periodicSkipJobs = new ConcurrentDictionary <string, ConcurrentBag <ulong> >();
        }