Example #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;
 }
Example #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;
 }
Example #3
0
 public FakeAsyncPeriodicBackgroundWorkerBase(IScorpioTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory)
 {
     timer.Period     = 3600000;
     timer.RunOnStart = true;
 }