Exemple #1
0
 public FlashSalePlanAppService(
     IFlashSalePlanRepository flashSalePlanRepository,
     IProductAppService productAppService,
     IDistributedCache <FlashSalePlanPreOrderCacheItem> tokenDistributedCache,
     IDistributedCache <FlashSalePlanCacheItem, Guid> planDistributedCache,
     IDistributedEventBus distributedEventBus,
     IFlashSaleResultRepository flashSaleResultRepository,
     IAbpDistributedLock distributedLock,
     IFlashSalePlanHasher flashSalePlanHasher,
     IFlashSaleInventoryManager flashSaleInventoryManager,
     IDistributedCache distributedCache,
     IOptionsMonitor <FlashSalesOptions> optionsMonitor)
     : base(flashSalePlanRepository)
 {
     FlashSalePlanRepository   = flashSalePlanRepository;
     ProductAppService         = productAppService;
     PreOrderDistributedCache  = tokenDistributedCache;
     PlanDistributedCache      = planDistributedCache;
     DistributedEventBus       = distributedEventBus;
     FlashSaleResultRepository = flashSaleResultRepository;
     DistributedLock           = distributedLock;
     FlashSalePlanHasher       = flashSalePlanHasher;
     FlashSaleInventoryManager = flashSaleInventoryManager;
     DistributedCache          = distributedCache;
     Options = optionsMonitor.CurrentValue;
 }
Exemple #2
0
 public TokenCleanupBackgroundWorker(
     AbpAsyncTimer timer,
     IServiceScopeFactory serviceScopeFactory,
     IOptionsMonitor <TokenCleanupOptions> cleanupOptions,
     IAbpDistributedLock distributedLock)
     : base(timer, serviceScopeFactory)
 {
     DistributedLock = distributedLock;
     timer.Period    = cleanupOptions.CurrentValue.CleanupPeriod;
 }
Exemple #3
0
 public DefaultProductInventoryProvider(
     IGuidGenerator guidGenerator,
     ICurrentTenant currentTenant,
     IDistributedEventBus distributedEventBus,
     IProductInventoryRepository productInventoryRepository,
     IAbpDistributedLock distributedLock,
     ILogger <DefaultProductInventoryProvider> logger)
 {
     _guidGenerator              = guidGenerator;
     _currentTenant              = currentTenant;
     _distributedEventBus        = distributedEventBus;
     _productInventoryRepository = productInventoryRepository;
     _distributedLock            = distributedLock;
     _logger = logger;
 }
Exemple #4
0
 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;
 }
Exemple #5
0
 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 LocalDistributedLock_Tests()
 {
     _distributedLock = GetRequiredService <IAbpDistributedLock>();
 }