Пример #1
0
 public OutboxProcessor(IServiceScopeFactory serviceScopeFactory, OutboxOptions outboxOptions,
                        ILogger <OutboxProcessor> logger)
 {
     _serviceScopeFactory = serviceScopeFactory;
     _logger   = logger;
     _interval = outboxOptions.Interval ?? TimeSpan.FromSeconds(1);
     _enabled  = outboxOptions.Enabled;
 }
 public MongoOutbox(IMongoDatabase database, IModuleRegistry moduleRegistry, OutboxOptions outboxOptions,
                    MessagingOptions messagingOptions, IModuleClient moduleClient, IAsyncMessageDispatcher asyncMessageDispatcher,
                    ILogger <MongoOutbox> logger)
 {
     _database               = database;
     _moduleClient           = moduleClient;
     _asyncMessageDispatcher = asyncMessageDispatcher;
     _logger  = logger;
     Enabled  = outboxOptions.Enabled;
     _modules = moduleRegistry.Modules.ToArray();
     _useBackgroundDispatcher = messagingOptions.UseBackgroundDispatcher;
     _collectionName          = string.IsNullOrWhiteSpace(outboxOptions.CollectionName)
         ? "outbox"
         : outboxOptions.CollectionName;
 }