Ejemplo n.º 1
0
 protected AsyncPeriodicBackgroundWorkerBase(
     RocketTimer timer,
     IServiceScopeFactory serviceScopeFactory)
 {
     ServiceScopeFactory = serviceScopeFactory;
     Timer          = timer;
     Timer.Elapsed += Timer_Elapsed;
 }
Ejemplo n.º 2
0
 public TokenCleanupBackgroundWorker(
     RocketTimer timer,
     IServiceScopeFactory serviceScopeFactory,
     IOptions <TokenCleanupOptions> options) : base(
         timer,
         serviceScopeFactory)
 {
     Options      = options.Value;
     timer.Period = Options.CleanupPeriod;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
        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;
        }