Ejemplo n.º 1
0
        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>();
        }
Ejemplo n.º 2
0
 public ChainSmsHandler(ISmsHandler current, IChainSmsHandler successor, IChainSmsHandler fallback)
 {
     _successor = successor;
     _current   = current;
     _fallback  = fallback;
 }