protected virtual async Task Timer_Elapsed(AbpAsyncTimer timer) { await CreateTopicAsync(); Consume(); Timer.Stop(); }
protected AsyncPeriodicBackgroundWorkerBase( AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) { ServiceScopeFactory = serviceScopeFactory; Timer = timer; Timer.Elapsed = Timer_Elapsed; }
protected virtual async Task Timer_Elapsed(AbpAsyncTimer timer) { if (Channel == null || Channel.IsOpen == false) { await TryCreateChannelAsync(); await TrySendQueueBindCommandsAsync(); } }
public MonitorWorker( AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, IDistributedEventBus distributedEventBus) : base(timer, serviceScopeFactory) { _distributedEventBus = distributedEventBus; Timer.Period = (int)KetumConsts.MonitorWorkerPeriod.TotalMilliseconds; }
public FileCheckerWorker( AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory ) : base( timer, serviceScopeFactory) { Timer.Period = 600000; //10 minutes }
protected virtual async Task Timer_Elapsed(AbpAsyncTimer timer) { if (Consumer == null) { await CreateTopicAsync(); Consume(); } }
public NotificationCleanupBackgroundWorker( AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, IOptions <AbpNotificationCleanupOptions> options) : base(timer, serviceScopeFactory) { Options = options.Value; timer.Period = Options.CleanupPeriod; }
public TokenCleanupBackgroundWorker( AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, IOptionsMonitor <TokenCleanupOptions> cleanupOptions, IAbpDistributedLock distributedLock) : base(timer, serviceScopeFactory) { DistributedLock = distributedLock; timer.Period = cleanupOptions.CurrentValue.CleanupPeriod; }
/// <summary> /// Handles the Elapsed event of the Timer. /// </summary> private async Task Timer_Elapsed(AbpAsyncTimer timer) { try { await DoWorkAsync(); } catch (Exception ex) { Logger.Warn(ex.ToString(), ex); } }
public ExchangeRateUpdateBackgroundWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, ICurrencyRepository reository, IExchangeRateApiService exchangeRateApiService ) : base(timer, serviceScopeFactory) { _reository = reository; _exchangeRateApiService = exchangeRateApiService; // 每x小时更新一次汇率 Timer.Period = 12 * 3600; }
/// <summary> /// Initializes a new instance of the <see cref="BackgroundJobManager"/> class. /// </summary> public BackgroundJobManager( IIocResolver iocResolver, IBackgroundJobStore store, AbpAsyncTimer timer) : base(timer) { _store = store; _iocResolver = iocResolver; EventBus = NullEventBus.Instance; Timer.Period = JobPollPeriod; }
public BackgroundJobWorker( AbpAsyncTimer timer, IOptions <AbpBackgroundJobOptions> jobOptions, IOptions <AbpBackgroundJobWorkerOptions> workerOptions, IServiceScopeFactory serviceScopeFactory) : base( timer, serviceScopeFactory) { WorkerOptions = workerOptions.Value; JobOptions = jobOptions.Value; Timer.Period = WorkerOptions.JobPollPeriod; }
/// <summary> /// 创建过期消息清理任务 /// </summary> /// <param name="timer"></param> /// <param name="storage"></param> /// <param name="initializer"></param> /// <param name="options"></param> /// <param name="serviceScopeFactory"></param> public AbpCapExpiresMessageCleanupBackgroundWorker( AbpAsyncTimer timer, IDataStorage storage, IStorageInitializer initializer, IOptions <AbpCAPEventBusOptions> options, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) { Storage = storage; Options = options.Value; Initializer = initializer; timer.Period = Options.CleanUpExpiresMessageInterval; }
public BackgroundJobWorker( AbpAsyncTimer timer, IOptions <AbpBackgroundJobOptions> jobOptions, IOptions <AbpBackgroundJobWorkerOptions> workerOptions, IServiceScopeFactory serviceScopeFactory, IAbpDistributedLock distributedLock) : base( timer, serviceScopeFactory) { DistributedLock = distributedLock; WorkerOptions = workerOptions.Value; JobOptions = jobOptions.Value; Timer.Period = WorkerOptions.JobPollPeriod; }
public RabbitMqMessageConsumer( IConnectionPool connectionPool, AbpAsyncTimer 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; }
public OutboxSender( IServiceProvider serviceProvider, AbpAsyncTimer timer, IDistributedEventBus distributedEventBus, IAbpDistributedLock distributedLock, IOptions <AbpEventBusBoxesOptions> eventBusBoxesOptions) { ServiceProvider = serviceProvider; DistributedEventBus = distributedEventBus; DistributedLock = distributedLock; EventBusBoxesOptions = eventBusBoxesOptions.Value; Timer = timer; Timer.Period = Convert.ToInt32(EventBusBoxesOptions.PeriodTimeSpan.TotalMilliseconds); Timer.Elapsed += TimerOnElapsed; Logger = NullLogger <OutboxSender> .Instance; StoppingTokenSource = new CancellationTokenSource(); StoppingToken = StoppingTokenSource.Token; }
public KafkaMessageConsumer( IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, IOptions <AbpKafkaOptions> options, IProducerPool producerPool, AbpAsyncTimer timer) { ConsumerPool = consumerPool; ExceptionNotifier = exceptionNotifier; ProducerPool = producerPool; Timer = timer; Options = options.Value; Logger = NullLogger <KafkaMessageConsumer> .Instance; Callbacks = new ConcurrentBag <Func <Message <string, byte[]>, Task> >(); Timer.Period = 5000; //5 sec. Timer.Elapsed = Timer_Elapsed; Timer.RunOnStart = true; }
public FileCrawlerRecordDownloadingWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) { Timer.Period = 60000; //1 minute }
private async Task Timer_Elapsed(AbpAsyncTimer timer) { await DoWorkAsync(StartCancellationToken); }
/// <summary> /// Initializes a new instance of the <see cref="PeriodicBackgroundWorkerBase"/> class. /// </summary> /// <param name="timer">A timer.</param> protected AsyncPeriodicBackgroundWorkerBase(AbpAsyncTimer timer) { Timer = timer; Timer.Elapsed += Timer_Elapsed; }
private async Task Timer_Elapsed(AbpAsyncTimer timer) { await DoWorkAsync(); }
public LogConfigCheckWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, INLogConfigLoader configLoader) : base(timer, serviceScopeFactory) { _configLoader = configLoader; Timer.Period = 5000; //5 sec }
private async Task TimerOnElapsed(AbpAsyncTimer arg) { await RunAsync(); }
public MonedaUpdateWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) { Timer.Period = 3600000; //1 hora }