public EventStoreBackgroundService(IEventStoreQueue storeQueue,
                                    IEventDbWriter eventWriter,
                                    IOptions <ApplicationSettings> options,
                                    IEventCleaner eventCleaner,
                                    IHostApplicationLifetime applicationLifetime)
 {
     _storeQueue          = storeQueue;
     _eventWriter         = eventWriter;
     _options             = options;
     _eventCleaner        = eventCleaner;
     _applicationLifetime = applicationLifetime;
     _localQueue          = new Queue <Event>();
 }
Пример #2
0
 public EventPushBackgroundService(IEventQueue eventQueue,
                                   IHubContext <EventHub, IEventClient> hubContext,
                                   IdentityGenerator identityGenerator,
                                   IOptions <ApplicationSettings> options,
                                   IEventStoreQueue storeQueue,
                                   IMemoryCache memoryCache)
 {
     _eventQueue        = eventQueue;
     _hubContext        = hubContext;
     _identityGenerator = identityGenerator;
     _options           = options;
     _storeQueue        = storeQueue;
     _memoryCache       = memoryCache;
 }
Пример #3
0
 public EventStoreBackgroundService(ILogger <EventStoreBackgroundService> logger,
                                    IEventStoreQueue storeQueue,
                                    IHubContext <EventHub, IEventClient> context,
                                    EventWriter eventWriter,
                                    IdentityGenerator identityGenerator,
                                    IOptionsMonitor <PrimarySettings> options, IMemoryCache memoryCache)
 {
     Logger            = logger;
     StoreQueue        = storeQueue;
     Context           = context;
     EventWriter       = eventWriter;
     IdentityGenerator = identityGenerator;
     MemoryCache       = memoryCache;
     Options           = options.CurrentValue;
 }
Пример #4
0
        public FakeLoggerProvider(IOptionsMonitor <FakeLoggerOptions> options, IEventStoreQueue eventStoreQueue)
        {
            var loggerOptions = options.CurrentValue;

            _interval  = loggerOptions.FlushPeriod;
            _batchSize = loggerOptions.BatchSize;
            _queueSize = loggerOptions.BackgroundQueueSize;

            _eventStoreQueue = eventStoreQueue ?? throw new ArgumentNullException(nameof(eventStoreQueue));

            _processId = Process.GetCurrentProcess().Id;

            _optionsChangeToken = options.OnChange(UpdateOptions);
            UpdateOptions(options.CurrentValue);
        }