public SyncHostedService(IChainSmsHandler chainSmsHandler, IInboxRepository inboxRepository, BackgroundConfiguration backgroundConfiguration, int maxBatchSize) { _chainSmsHandler = chainSmsHandler; _inboxRepository = inboxRepository; _backgroundConfiguration = backgroundConfiguration; if (maxBatchSize <= 0) { throw new ArgumentException("Batch size should be positive", nameof(maxBatchSize)); } _maxBatchSize = maxBatchSize; _smsSet = new HashSet <DbSms>(_maxBatchSize, new SmsEqualityComparer()); _tasks = new List <Task>(); }
public ChainSmsHandler(ISmsHandler current, IChainSmsHandler successor, IChainSmsHandler fallback) { _successor = successor; _current = current; _fallback = fallback; }