Example #1
0
 public Scheduler(IMutex mutex, IServiceScopeFactory scopeFactory, IDispatcher dispatcher)
 {
     this._tasks        = new ConcurrentDictionary <string, ScheduledEvent>();
     this._mutex        = mutex;
     this._scopeFactory = scopeFactory;
     this._dispatcher   = dispatcher;
 }
Example #2
0
 public Scheduler(IMutex mutex, IServiceScopeFactory scopeFactory, IDispatcher dispatcher)
 {
     this._tasks             = new ConcurrentDictionary <string, ScheduledTask>();
     this._mutex             = mutex;
     this._scopeFactory      = scopeFactory;
     this._dispatcher        = dispatcher;
     this._currentWorkerName = "_default";
 }
Example #3
0
        public JobScheduler(ILoggerFactory loggerFactory, IMutex mutex, JobSchedulerOptions options)
        {
            EnsureArg.IsNotNull(loggerFactory, nameof(loggerFactory));
            EnsureArg.IsNotNull(options, nameof(options));

            this.logger  = loggerFactory.CreateLogger <JobScheduler>();
            this.mutex   = mutex ?? new InProcessMutex(null);
            this.Options = options;
        }
Example #4
0
 public JobScheduler(ILoggerFactory loggerFactory, ITracer tracer, IMutex mutex)
     : this(loggerFactory, tracer, mutex, null)
 {
 }
Example #5
0
 public void Register(IMutex mutex)
 {
     _mutexes.Add(mutex);
 }
Example #6
0
 public Scheduler(IMutex mutex, IServiceScopeFactory scopeFactory)
 {
     this._tasks        = new ConcurrentBag <ScheduledEvent>();
     this._mutex        = mutex;
     this._scopeFactory = scopeFactory;
 }