protected AsyncPeriodicBackgroundWorkerBase( RocketTimer timer, IServiceScopeFactory serviceScopeFactory) { ServiceScopeFactory = serviceScopeFactory; Timer = timer; Timer.Elapsed += Timer_Elapsed; }
public TokenCleanupBackgroundWorker( RocketTimer timer, IServiceScopeFactory serviceScopeFactory, IOptions <TokenCleanupOptions> options) : base( timer, serviceScopeFactory) { Options = options.Value; timer.Period = Options.CleanupPeriod; }
public BackgroundJobWorker( RocketTimer timer, IOptions <RocketBackgroundJobOptions> jobOptions, IOptions <RocketBackgroundJobWorkerOptions> workerOptions, IServiceScopeFactory serviceScopeFactory) : base( timer, serviceScopeFactory) { WorkerOptions = workerOptions.Value; JobOptions = jobOptions.Value; Timer.Period = WorkerOptions.JobPollPeriod; }
public RabbitMqMessageConsumer( IConnectionPool connectionPool, RocketTimer timer, IExceptionNotifier exceptionNotifier) { ConnectionPool = connectionPool; Timer = timer; ExceptionNotifier = exceptionNotifier; Logger = NullLogger <RabbitMqMessageConsumer> .Instance; QueueBindCommands = new ConcurrentQueue <QueueBindCommand> (); Callbacks = new ConcurrentBag <Func <IModel, BasicDeliverEventArgs, Task> > (); Timer.Period = 5000; //5 sec. Timer.Elapsed += Timer_Elapsed; Timer.RunOnStart = true; }