public BatchEngine(IBatchStore store, IDependencyResolver resolver, ILogger logger, BatchSettings batchSettings) { _store = store; _logger = logger; _settings = batchSettings ?? new BatchSettings(); _resolver = resolver; }
public BatchEngine(IBatchStore store, IDependencyResolver resolver = null, ILogger logger = null, BatchSettings batchSettings = null) { _store = store; _jobExecutor = new DependencyInjectionJobExecutor(resolver); _logger = logger; _settings = batchSettings ?? new BatchSettings(); }
public BatchEngine() { if (MinionConfiguration.Configuration.HeartBeatFrequency <= 0) { throw new ArgumentOutOfRangeException( nameof(MinionConfiguration.Configuration.HeartBeatFrequency), "Heartbeat frequency must be more than 0"); } if (MinionConfiguration.Configuration.NumberOfParallelJobs <= 0) { throw new ArgumentOutOfRangeException( nameof(MinionConfiguration.Configuration.NumberOfParallelJobs), "Number of parallel jobs must be more than 0"); } if (MinionConfiguration.Configuration.PollingFrequency <= 0) { throw new ArgumentOutOfRangeException( nameof(MinionConfiguration.Configuration.PollingFrequency), "Polling frequency must be more than 0"); } _store = MinionConfiguration.Configuration.Store; _logger = MinionConfiguration.Configuration.Logger; _settings = new BatchSettings { HeartBeatFrequency = MinionConfiguration.Configuration.HeartBeatFrequency, NumberOfParallelJobs = MinionConfiguration.Configuration.NumberOfParallelJobs, PollingFrequency = MinionConfiguration.Configuration.PollingFrequency, }; _resolver = MinionConfiguration.Configuration.DependencyResolver; }
public void UseBatchStore(IBatchStore store) { Store = store; var cts = new CancellationTokenSource(); Task.Run(() => Store.InitAsync(), cts.Token).Wait(cts.Token); }
public JobSchedulerTests() { _store = Substitute.For <IBatchStore>(); _dateService = Substitute.For <IDateService>(); _scheduler = new JobScheduler(_store, _dateService); _now = new DateTime(2018, 1, 2, 3, 4, 5); _dateService.GetNow().Returns(_now); }
public JobScheduler(IBatchStore store, IDateService dateService) { _store = store; _dateService = dateService; }
public BathcEngineTests() { _store = Substitute.For <IBatchStore>(); _dependencyResolver = Substitute.For <IDependencyResolver>(); _logger = Substitute.For <ILogger>(); }
public JobScheduler() { _store = MinionConfiguration.Configuration.Store; _dateService = MinionConfiguration.Configuration.DateService; }