Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="timer"></param>
 /// <param name="serviceScopeFactory"></param>
 protected AsyncPeriodicBackgroundWorkerBase(
     IScorpioTimer timer,
     IServiceScopeFactory serviceScopeFactory)
 {
     ServiceScopeFactory = serviceScopeFactory;
     Timer          = timer;
     Timer.Elapsed += Timer_Elapsed;
 }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="timer"></param>
 /// <param name="jobOptions"></param>
 /// <param name="workerOptions"></param>
 /// <param name="serviceScopeFactory"></param>
 public BackgroundJobWorker(
     IScorpioTimer timer,
     IOptions <BackgroundJobOptions> jobOptions,
     IOptions <BackgroundJobWorkerOptions> workerOptions,
     IServiceScopeFactory serviceScopeFactory)
     : base(
         timer,
         serviceScopeFactory)
 {
     WorkerOptions = workerOptions.Value;
     JobOptions    = jobOptions.Value;
     Timer.Period  = WorkerOptions.JobPollPeriod;
 }
Exemple #3
0
 public FakeAsyncPeriodicBackgroundWorkerBase(IScorpioTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory)
 {
     timer.Period     = 3600000;
     timer.RunOnStart = true;
 }