コード例 #1
0
        public EventPublishingService(
            IConnection Connection,
            QueueIntegrationConfiguration Configuration,
            IByteConverter Converter,
            ILogger <EventPublishingService> Logger)
        {
            _connection = Connection ??
                          throw new ArgumentNullException(nameof(Connection));
            _config = Configuration ??
                      throw new ArgumentNullException(nameof(Configuration));
            _converter = Converter ??
                         throw new ArgumentNullException(nameof(Converter));
            _logger = Logger ??
                      throw new ArgumentNullException(nameof(Logger));

            _publishQueue = new BlockingCollection <IEvent>(
                new ConcurrentQueue <IEvent>());
            _publishers      = new Dictionary <Type, IEventPublisher>();
            _eventLoopSource = new CancellationTokenSource();
        }
コード例 #2
0
        public EventConsumingService(
            IConnection Connection,
            IServiceProvider Provider,
            QueueIntegrationConfiguration Configuration,
            IOptions <EventHandlingOptions> Options,
            IByteConverter Converter,
            ILogger <EventConsumingService> Logger)
        {
            _connection = Connection ??
                          throw new ArgumentNullException(nameof(Connection));
            _provider = Provider ??
                        throw new ArgumentNullException(nameof(Provider));
            _config = Configuration ??
                      throw new ArgumentNullException(nameof(Configuration));
            _options = Options ??
                       throw new ArgumentNullException(nameof(Options));
            _converter = Converter ??
                         throw new ArgumentNullException(nameof(Converter));
            _logger = Logger ??
                      throw new ArgumentNullException(nameof(Logger));

            _sequences     = new Dictionary <Type, IObservable <BasicDeliverEventArgs> >();
            _subscriptions = new List <IDisposable>();
        }